···104104 };
105105 };
106106107107- config = {
107107+ options.system.disableInstallerTools = mkOption {
108108+ internal = true;
109109+ type = types.bool;
110110+ default = false;
111111+ description = ''
112112+ Disable nixos-rebuild, nixos-generate-config, nixos-installer
113113+ and other NixOS tools. This is useful to shrink embedded,
114114+ read-only systems which are not expected to be rebuild or
115115+ reconfigure themselves. Use at your own risk!
116116+ '';
117117+ };
118118+119119+ config = lib.mkIf (!config.system.disableInstallerTools) {
120120+108121 system.nixos-generate-config.configuration = mkDefault ''
109122 # Edit this configuration file to define what should be installed on
110123 # your system. Help is available in the configuration.nix(5) man page