nixvim
nixvim copied to clipboard
modules/misc: nixpkgs module
NixOS^1, home-manager^2 and nix-darwin^3 all have a nixpkkgs module where the pkgs passed to modules can be configured or overridden.
This can be used to specify a specific lock or channel, and it can be used to define overlays and config such as enableUnfree.
Configuring pkgs is also useful for cross-compiliation (by setting hostPlatform and buildPlatform).
Currently this is not possible in standalone nixvim builds, instead pkgs must be configured before passing it to makeNixvimWithModule.
This would also make it possible to have nixvim's pkgs be different to that used by the host modules; currently many users are forced to use the standalone build just to use a different nixpkgs channel to their NixOS/home-manager configs.
~~Adding this would also make it easier to add extensions to pkgs.lib via an overlay, such as merging our maintainers into lib.maintainers or making nixvim's helper lib available as (e.g.) lib.nixvim.~~
EDIT: done in #1963, but it has to be done as a specialArg because lib is passed in by lib.evalModules.