nixpkgs.overlays
List of overlays to apply to Nixpkgs.
This option allows modifying the Nixpkgs package set accessed through the pkgs
module argument.
For details, see the Overlays chapter in the Nixpkgs manual.
Overlays specified using the nixpkgs.overlays
option will be
applied after the overlays that were already included in nixpkgs.pkgs
.
Type: list of (nixpkgs overlay)
Default:
[ ]
Example:
[
# Add a vim plugin that isn't packaged in nixpkgs
(final: prev: {
easygrep = final.vimUtils.buildVimPlugin {
name = "vim-easygrep";
src = final.fetchFromGitHub {
owner = "dkprice";
repo = "vim-easygrep";
rev = "d0c36a77cc63c22648e792796b1815b44164653a";
hash = "sha256-bL33/S+caNmEYGcMLNCanFZyEYUOUmSsedCVBn4tV3g=";
};
};
})
# Override neovim-unwrapped with one from a flake input
# Using `stdenv.hostPlatform` to access `system`
(final: prev: {
neovim-unwrapped =
inputs.neovim-nightly-overlay.packages.${final.stdenv.hostPlatform.system}.default;
})
# Override neovim-unwrapped to tweak its desktop entry
(final: prev: {
neovim-unwrapped = prev.neovim-unwrapped.overrideAttrs (old: {
postInstall = old.postInstall or "" + ''
substituteInPlace $out/share/applications/nvim.desktop \
--replace "TryExec=nvim" "" \
--replace "Terminal=true" "Terminal=false" \
--replace "Exec=nvim %F" "Exec=kitty -e nvim %F"
'';
});
})
]
Declared by:
nixpkgs.pkgs
If set, the pkgs
argument to all Nixvim modules is the value of this option.
If unset, an assertion will trigger. In the future a pkgs
instance will be constructed.
This option can be used by external applications to increase the performance of evaluation,
or to create packages that depend on a container that should be built with the exact same
evaluation of Nixpkgs, for example.
Applications like this should set their default value using lib.mkDefault
,
so user-provided configuration can override it without using lib
.
E.g. Nixvim’s home-manager module can re-use the pkgs
instance from the “host” modules.
note
Using a distinct version of Nixpkgs with Nixvim may be an unexpected source of problems. Use this option with care.
Type: An evaluation of Nixpkgs; the top level attribute set of packages
Default:
The pkgs
inherited from your host config (i.e. NixOS, home-manager, or nix-darwin),
or the pkgs
supplied to makeNixvimWithModule
when building a standalone nixvim.
caution
This default will be removed in a future version of nixvim
Example:
import <nixpkgs> { }
Declared by: