about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-11-19 21:21:16 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-11-28 16:47:28 +0000
commit61609b59eeadd08716feef795f74cf980bf401d1 (patch)
tree673567ea4bd41dc926e8917aae70026dbde507ed /nixos/modules/installer
parent42d2ec6b04eda050b0d8c7c537b8e13b71be623d (diff)
nixos/system.disableInstallerTools: Do define options without effect
These won't cause anything to appear in toplevel.

(cherry picked from commit 64b587e3e22dc078cd4c73d2d8f5331d8321ae65)
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/tools.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index 15e10128ac9a4..9ccc76a82c95a 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -130,7 +130,7 @@ in
     '';
   };
 
-  config = lib.mkIf (config.nix.enable && !config.system.disableInstallerTools) {
+  config = lib.mkMerge [ (lib.mkIf (config.nix.enable && !config.system.disableInstallerTools) {
 
     system.nixos-generate-config.configuration = mkDefault ''
       # Edit this configuration file to define what should be installed on
@@ -257,10 +257,13 @@ in
 
     documentation.man.man-db.skipPackages = [ nixos-version ];
 
+  })
+
+  # These may be used in auxiliary scripts (ie not part of toplevel), so they are defined unconditionally.
+  ({
     system.build = {
       inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-enter;
     };
-
-  };
+  })];
 
 }