wiki/_next/data/Ie9t5zutrXP6Of75Cb5xF/tools.nix.overrides-and-overlays.json

1 line
2.6 KiB
JSON
Raw Permalink Normal View History

2022-07-29 15:41:17 +00:00
{"pageProps":{"metadata":{"date":"2021-07-28 12:54:40 +08:00","date_modified":"2021-07-28 12:55:03 +08:00","language":"en","source":""},"title":"Nix overrides and overlays","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can override values in Nix as a way to customize nixpkgs.\nFor example, if you want to use a different version from the nixpkgs channel, you can change the appropriate value.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-nix"]},"children":[{"type":"text","value":"let overlay = self: super:\n {\n ncmpcpp = super.ncmpcpp.override { visualizerSupport = true; };\n }\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For another example, you can see some examples from "},{"type":"element","tagName":"a","properties":{"href":"https://github.com/neovim/neovim/blob/f695457f815544d0dc16469569c70556e3165bb6/contrib/flake.nix"},"children":[{"type":"text","value":"Neovim"}]},{"type":"text","value":" and "},{"type":"element","tagName":"a","properties":{"href":"https://gitlab.com/veloren/veloren/-/tree/685f4971ac0deb31b301e9d2bc0201d2531fd895/nix"},"children":[{"type":"text","value":"Veloren"}]},{"type":"text","value":" (which also uses Nix flakes).\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"You can set overlays automatically either by setting "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"nixpkgs.overlays"}]},{"type":"text","value":" from your system configuration or "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"~/.config/nixpkgs/overlays/"}]},{"type":"text","value":" folder for user-specific settings.\nYou could also set overlays for standalone Nix code similarly through the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"overlays"}]},{"type":"text","value":" key — e.g., "},{"type":"element","tagName":"code","properties":{"className":["inline-code"]},"children":[{"type":"text","value":"import <nixpkgs> ? { overlays = (self: super: { } ); };"}]},{"type":"text","value":".\n"}]}]},"backlinks":[{"path":"/tools.nix","title":"Nix package manager"}]},"__N_SSG":true}