pkgs.pkgsModule: init

Having `pkgs` as a module argument is common, beyond just NixOS,
making this a useful convenience for setting it.

(cherry picked from commit dd6d8e3f0c38370ac8fb082ea7a3be06c949deed)
This commit is contained in:
Robert Hensing 2021-12-03 12:15:20 +00:00
parent efeefb2af1
commit 270426ab6e

View file

@ -33245,6 +33245,20 @@ with pkgs;
in
c.config.system.build // c;
/*
A NixOS/home-manager/arion/... module that sets the `pkgs` module argument.
*/
pkgsModule = { lib, options, ... }: {
config =
if options?nixpkgs.pkgs then {
# legacy / nixpkgs.nix style
nixpkgs.pkgs = pkgs;
}
else {
# minimal
_module.args.pkgs = pkgs;
};
};
/*
* Run a NixOS VM network test using this evaluation of Nixpkgs.