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)

Changed files
+14
pkgs
top-level
+14
pkgs/top-level/all-packages.nix
···
in
c.config.system.build // c;
/*
* Run a NixOS VM network test using this evaluation of Nixpkgs.
···
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.