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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user