diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 6e3e2eb475f3..34526c1b20a3 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -217,7 +217,7 @@ in imports = let mkToolModule = { name, package ? pkgs.${name} }: { config, ... }: { options.system.tools.${name}.enable = lib.mkEnableOption "${name} script" // { - default = config.nix.enable; + default = config.nix.enable && ! config.system.disableInstallerTools; internal = true; }; @@ -235,27 +235,14 @@ in (mkToolModule { name = "nixos-version"; package = nixos-version; }) ]; - config = lib.mkMerge [ - (lib.mkIf config.system.disableInstallerTools { - system.tools = { - nixos-build-vms.enable = false; - nixos-enter.enable = false; - nixos-generate-config.enable = false; - nixos-install.enable = false; - nixos-option.enable = false; - nixos-rebuild.enable = false; - nixos-version.enable = false; - }; - }) - { - documentation.man.man-db.skipPackages = [ nixos-version ]; + config = { + 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-generate-config nixos-install nixos-rebuild; - nixos-option = lib.warn "Accessing nixos-option through `config.system.build` is deprecated, use `pkgs.nixos-option` instead." pkgs.nixos-option; - nixos-enter = lib.warn "Accessing nixos-enter through `config.system.build` is deprecated, use `pkgs.nixos-enter` instead." pkgs.nixos-enter; - }; - } - ]; + # These may be used in auxiliary scripts (ie not part of toplevel), so they are defined unconditionally. + system.build = { + inherit nixos-generate-config nixos-install nixos-rebuild; + nixos-option = lib.warn "Accessing nixos-option through `config.system.build` is deprecated, use `pkgs.nixos-option` instead." pkgs.nixos-option; + nixos-enter = lib.warn "Accessing nixos-enter through `config.system.build` is deprecated, use `pkgs.nixos-enter` instead." pkgs.nixos-enter; + }; + }; }