# Nix overrides and overlays

Date: 2021-07-28 12:54:40 +08:00Date modified: 2021-07-28 12:55:03 +08:00

You can override values in Nix as a way to customize nixpkgs. For example, if you want to use a different version from the nixpkgs channel, you can change the appropriate value.

    let overlay = self: super:
          {
            ncmpcpp = super.ncmpcpp.override { visualizerSupport = true; };
          }

For another example, you can see some examples from Neovim and Veloren (which also uses Nix flakes).

You can set overlays automatically either by setting `nixpkgs.overlays` from your system configuration or `~/.config/nixpkgs/overlays/` folder for user-specific settings. You could also set overlays for standalone Nix code similarly through the `overlays` key — e.g., `import <nixpkgs> ? { overlays = (self: super: { } ); };`.

## Backlinks

- Nix package manager