summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2021-09-14 20:41:02 +0300
committerGitHub <noreply@github.com>2021-09-14 20:41:02 +0300
commit045bf139dbf4d351d72599161a357ba2971ea044 (patch)
tree4258462aef4ffee700d78910cf274a2bd1e4b06e
parentMerge pull request #137592 from r-ryantm/auto-update/proselint (diff)
parentinstallers/tools: add system.disableInstallerTools option (diff)
downloadnixpkgs-045bf139dbf4d351d72599161a357ba2971ea044.tar.gz
Merge pull request #104828 from matthewbauer/add-disableInstallerTools-option
-rw-r--r--nixos/modules/installer/tools/tools.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index f79ed3493dfb..2f3b0cdd48f2 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -104,7 +104,20 @@ in
};
};
- config = {
+ options.system.disableInstallerTools = mkOption {
+ internal = true;
+ type = types.bool;
+ default = false;
+ description = ''
+ Disable nixos-rebuild, nixos-generate-config, nixos-installer
+ and other NixOS tools. This is useful to shrink embedded,
+ read-only systems which are not expected to be rebuild or
+ reconfigure themselves. Use at your own risk!
+ '';
+ };
+
+ config = lib.mkIf (!config.system.disableInstallerTools) {
+
system.nixos-generate-config.configuration = mkDefault ''
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page