summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2023-10-06 23:52:04 +0300
committerK900 <me@0upti.me>2023-10-06 23:52:04 +0300
commit80cc25eb51e52b2b90d1080ca583b46dec9c2e3e (patch)
tree765c3639aeeba9297d415baa0b912132e7bcf470 /nixos/lib
parentbd1cf55f63d58a319ac09562caaa4bf4f427465b (diff)
nixos/testing: fix eval for tests created without make-python-test.nix
We have too many test entrypoints and this is a problem.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/testing/nodes.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/nixos/lib/testing/nodes.nix b/nixos/lib/testing/nodes.nix
index c6ba2a4feac6e..a47d1c98ecec3 100644
--- a/nixos/lib/testing/nodes.nix
+++ b/nixos/lib/testing/nodes.nix
@@ -30,13 +30,15 @@ let
             })
           ({ options, ... }: {
             key = "nodes.nix-pkgs";
-            config = mkIf (!options.nixpkgs.pkgs.isDefined) {
-              # Ensure we do not use aliases. Ideally this is only set
-              # when the test framework is used by Nixpkgs NixOS tests.
-              nixpkgs.config.allowAliases = false;
-              # TODO: switch to nixpkgs.hostPlatform and make sure containers-imperative test still evaluates.
-              nixpkgs.system = hostPkgs.stdenv.hostPlatform.system;
-            };
+            config = optionalAttrs (!config.node.pkgsReadOnly) (
+              mkIf (!options.nixpkgs.pkgs.isDefined) {
+                # Ensure we do not use aliases. Ideally this is only set
+                # when the test framework is used by Nixpkgs NixOS tests.
+                nixpkgs.config.allowAliases = false;
+                # TODO: switch to nixpkgs.hostPlatform and make sure containers-imperative test still evaluates.
+                nixpkgs.system = hostPkgs.stdenv.hostPlatform.system;
+              }
+            );
           })
           testModuleArgs.config.extraBaseModules
         ];