about summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-06-09 11:27:29 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-07-10 13:35:54 +0200
commit711e653a65300652f680aa9aa7e26b609f7d232e (patch)
treeba6d39bde94e4dc8d5058d2b03ba832e180178b7 /nixos/lib
parente15308727693143d45904eeba3cd0b72fd643be5 (diff)
nixos/eval-config: Allow system to be set modularly when arg is null
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/eval-config.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/lib/eval-config.nix b/nixos/lib/eval-config.nix
index 3b58ef297973e..791a03a3ba3cc 100644
--- a/nixos/lib/eval-config.nix
+++ b/nixos/lib/eval-config.nix
@@ -9,7 +9,9 @@
 # expressions are ever made modular at the top level) can just use
 # types.submodule instead of using eval-config.nix
 evalConfigArgs@
-{ # !!! system can be set modularly, would be nice to remove
+{ # !!! system can be set modularly, would be nice to remove,
+  #     however, removing or changing this default is too much
+  #     of a breaking change. To set it modularly, pass `null`.
   system ? builtins.currentSystem
 , # !!! is this argument needed any more? The pkgs argument can
   # be set modularly anyway.
@@ -48,7 +50,7 @@ let
       # this.  Since the latter defaults to the former, the former should
       # default to the argument. That way this new default could propagate all
       # they way through, but has the last priority behind everything else.
-      nixpkgs.system = lib.mkDefault system;
+      nixpkgs.system = lib.mkIf (system != null) (lib.mkDefault system);
 
       _module.args.pkgs = lib.mkIf (pkgs_ != null) (lib.mkForce pkgs_);
     };