Open MattSturgeon opened 1 week ago
Originally commented on https://github.com/nix-community/nixvim/pull/1800#issuecomment-2205696343
Looks like the way home-manager handles the "default" pkgs
is to set the pkgsPath
special arg, and use that to construct pkgs
: defaultPkgs = import pkgsPath config.nixpkgs
.
Meaning they use a fresh instance, with its own config/overlays, but matching the same locked channel.
Unless these nixos module options are used:
home-manager.useGlobalPkgs
Whether to enable using the system configuration’s
pkgs
argument in Home Manager. This disables the Home Manager optionsnixpkgs.*
.
home-manager.useUserPackages
Whether to enable installation of user packages through the
users.users.<name>.packages
option.
I believe when home-manager is used standalone, it sets pkgsPath
to <nixpkgs>
when not using flakes or home-manager's inputs.nixpkgs
otherwise.
It might do the same thing when it's a NixOS module, or it might use pkgs.path
(I'm not sure).
NixOS^1, home-manager^2 and nix-darwin^3 all have a
nixpkkgs
module where thepkgs
passed to modules can be configured or overridden.This is mainly used for cross-compiliation (by setting
hostPlatform
andbuildPlatform
) and also for addingoverlays
.Currently this is not possible in standalone nixvim builds, instead
pkgs
must be configured before passing it tomakeNixvimWithModule
.Adding this would also make it easier to add extensions to\ EDIT: we can still do this, but it has to be done as a specialArg becausepkgs.lib
via an overlay, such as merging our maintainers intolib.maintainers
or making nixvim's helper lib available as (e.g.)lib.nixvim
.lib
is passed in bylib.evalModules
.