Loading nixos/lib/testing/nodes.nix +21 −1 Original line number Diff line number Diff line testModuleArgs@{ config, lib, hostPkgs, nodes, ... }: let inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mdDoc; inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mkIf mdDoc; baseOS = import ../eval-config.nix { Loading Loading @@ -72,6 +72,19 @@ in default = { }; }; node.pkgs = mkOption { description = mdDoc '' The Nixpkgs to use for the nodes. Setting this will make the `nixpkgs.*` options read-only, to avoid mistakenly testing with a Nixpkgs configuration that diverges from regular use. ''; type = types.nullOr types.pkgs; default = null; defaultText = literalMD '' `null`, so construct `pkgs` according to the `nixpkgs.*` options as usual. ''; }; node.specialArgs = mkOption { type = types.lazyAttrsOf types.raw; default = { }; Loading Loading @@ -104,5 +117,12 @@ in config.nodes; passthru.nodes = config.nodesCompat; defaults = mkIf (config.node.pkgs != null) { nixpkgs.pkgs = config.node.pkgs; imports = [ ../../modules/misc/nixpkgs/read-only.nix ]; disabledModules = [{ key = "nodes.nix-pkgs"; }]; }; }; } nixos/tests/all-tests.nix +1 −5 Original line number Diff line number Diff line Loading @@ -79,11 +79,7 @@ let # warnIf pkgs.config.allowAliases "nixosTests: pkgs includes aliases." { _class = "nixosTest"; defaults = { nixpkgs.pkgs = pkgs; imports = [ ../modules/misc/nixpkgs/read-only.nix ]; disabledModules = [{ key = "nodes.nix-pkgs"; }]; }; node.pkgs = pkgs; }; in { Loading Loading
nixos/lib/testing/nodes.nix +21 −1 Original line number Diff line number Diff line testModuleArgs@{ config, lib, hostPkgs, nodes, ... }: let inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mdDoc; inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mkIf mdDoc; baseOS = import ../eval-config.nix { Loading Loading @@ -72,6 +72,19 @@ in default = { }; }; node.pkgs = mkOption { description = mdDoc '' The Nixpkgs to use for the nodes. Setting this will make the `nixpkgs.*` options read-only, to avoid mistakenly testing with a Nixpkgs configuration that diverges from regular use. ''; type = types.nullOr types.pkgs; default = null; defaultText = literalMD '' `null`, so construct `pkgs` according to the `nixpkgs.*` options as usual. ''; }; node.specialArgs = mkOption { type = types.lazyAttrsOf types.raw; default = { }; Loading Loading @@ -104,5 +117,12 @@ in config.nodes; passthru.nodes = config.nodesCompat; defaults = mkIf (config.node.pkgs != null) { nixpkgs.pkgs = config.node.pkgs; imports = [ ../../modules/misc/nixpkgs/read-only.nix ]; disabledModules = [{ key = "nodes.nix-pkgs"; }]; }; }; }
nixos/tests/all-tests.nix +1 −5 Original line number Diff line number Diff line Loading @@ -79,11 +79,7 @@ let # warnIf pkgs.config.allowAliases "nixosTests: pkgs includes aliases." { _class = "nixosTest"; defaults = { nixpkgs.pkgs = pkgs; imports = [ ../modules/misc/nixpkgs/read-only.nix ]; disabledModules = [{ key = "nodes.nix-pkgs"; }]; }; node.pkgs = pkgs; }; in { Loading