diff options
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/activation/activation-script.nix | 6 | ||||
-rwxr-xr-x | nixos/modules/system/activation/switch-to-configuration.pl | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/kernel_config.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/luksroot.nix | 6 | ||||
-rw-r--r-- | nixos/modules/system/boot/networkd.nix | 12 | ||||
-rw-r--r-- | nixos/modules/system/boot/plymouth.nix | 6 | ||||
-rw-r--r-- | nixos/modules/system/boot/stage-1.nix | 2 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd/initrd.nix | 8 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd/shutdown.nix | 22 |
9 files changed, 37 insertions, 29 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix index 88b3ac1d18e8..5a61d5463d21 100644 --- a/nixos/modules/system/activation/activation-script.nix +++ b/nixos/modules/system/activation/activation-script.nix @@ -92,8 +92,8 @@ let Whether this activation script supports being dry-activated. These activation scripts will also be executed on dry-activate activations with the environment variable - <literal>NIXOS_ACTION</literal> being set to <literal>dry-activate - </literal>. it's important that these activation scripts don't + <literal>NIXOS_ACTION</literal> being set to <literal>dry-activate</literal>. + it's important that these activation scripts don't modify anything about the system when the variable is set. ''; }; @@ -143,7 +143,7 @@ in readOnly = true; internal = true; default = systemActivationScript (removeAttrs config.system.activationScripts [ "script" ]) true; - defaultText = literalDocBook "generated activation script"; + defaultText = literalMD "generated activation script"; }; system.userActivationScripts = mkOption { diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index f39549db883d..9a4c635402d1 100755 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -167,7 +167,7 @@ sub get_active_units { # Takes the name of the unit as an argument and returns a bool whether the unit is active or not. sub unit_is_active { my ($unit_name) = @_; - my $units = busctl_call_systemd1_mgr("ListUnitsByNames", "as", 1, $unit_name)->{data}->[0]; + my $units = busctl_call_systemd1_mgr("ListUnitsByNames", "as", 1, , "--", $unit_name)->{data}->[0]; if (scalar(@{$units}) == 0) { return 0; } diff --git a/nixos/modules/system/boot/kernel_config.nix b/nixos/modules/system/boot/kernel_config.nix index 448835c3e625..997c404be168 100644 --- a/nixos/modules/system/boot/kernel_config.nix +++ b/nixos/modules/system/boot/kernel_config.nix @@ -91,7 +91,7 @@ in USB? y DEBUG n ''; - description = '' + description = lib.mdDoc '' The result of converting the structured kernel configuration in settings to an intermediate string that can be parsed by generate-config.pl to answer the kernel `make defconfig`. diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index 78301a57bd97..8cd16974916c 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -532,15 +532,15 @@ in boot.initrd.luks.reusePassphrases = mkOption { type = types.bool; default = true; - description = '' + description = lib.mdDoc '' When opening a new LUKS device try reusing last successful passphrase. Useful for mounting a number of devices that use the same passphrase without retyping it several times. - Such setup can be useful if you use <command>cryptsetup - luksSuspend</command>. Different LUKS devices will still have + Such setup can be useful if you use {command}`cryptsetup luksSuspend`. + Different LUKS devices will still have different master keys even when using the same passphrase. ''; }; diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index a4e335e00379..71891ebbfefe 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -451,6 +451,7 @@ let "Multicast" "AllMulticast" "Unmanaged" + "Group" "RequiredForOnline" "RequiredFamilyForOnline" "ActivationPolicy" @@ -463,6 +464,8 @@ let (assertValueOneOf "AllMulticast" boolValues) (assertValueOneOf "Promiscuous" boolValues) (assertValueOneOf "Unmanaged" boolValues) + (assertInt "Group") + (assertRange "Group" 0 2147483647) (assertValueOneOf "RequiredForOnline" (boolValues ++ [ "missing" "off" @@ -800,10 +803,12 @@ let sectionDHCPServer = checkUnitConfig "DHCPServer" [ (assertOnlyFields [ + "ServerAddress" "PoolOffset" "PoolSize" "DefaultLeaseTimeSec" "MaxLeaseTimeSec" + "UplinkInterface" "EmitDNS" "DNS" "EmitNTP" @@ -817,10 +822,15 @@ let "EmitLPR" "LPR" "EmitRouter" + "Router" "EmitTimezone" "Timezone" "SendOption" "SendVendorOption" + "BindToInterface" + "RelayTarget" + "RelayAgentCircuitId" + "RelayAgentRemoteId" ]) (assertInt "PoolOffset") (assertMinimum "PoolOffset" 0) @@ -834,6 +844,7 @@ let (assertValueOneOf "EmitLPR" boolValues) (assertValueOneOf "EmitRouter" boolValues) (assertValueOneOf "EmitTimezone" boolValues) + (assertValueOneOf "BindToInterface" boolValues) ]; sectionIPv6SendRA = checkUnitConfig "IPv6SendRA" [ @@ -842,6 +853,7 @@ let "OtherInformation" "RouterLifetimeSec" "RouterPreference" + "UplinkInterface" "EmitDNS" "DNS" "EmitDomains" diff --git a/nixos/modules/system/boot/plymouth.nix b/nixos/modules/system/boot/plymouth.nix index 02d8fcf4799c..6e20d7dc5e0f 100644 --- a/nixos/modules/system/boot/plymouth.nix +++ b/nixos/modules/system/boot/plymouth.nix @@ -75,10 +75,10 @@ in themePackages = mkOption { default = lib.optional (cfg.theme == "breeze") nixosBreezePlymouth; - defaultText = literalDocBook '' + defaultText = literalMD '' A NixOS branded variant of the breeze theme when - <literal>config.${opt.theme} == "breeze"</literal>, otherwise - <literal>[ ]</literal>. + `config.${opt.theme} == "breeze"`, otherwise + `[ ]`. ''; type = types.listOf types.package; description = lib.mdDoc '' diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index 37adcc531d3d..66b51cd72606 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -611,7 +611,7 @@ in then "zstd" else "gzip" ); - defaultText = literalDocBook "<literal>zstd</literal> if the kernel supports it (5.9+), <literal>gzip</literal> if not"; + defaultText = literalMD "`zstd` if the kernel supports it (5.9+), `gzip` if not"; type = types.either types.str (types.functionTo types.str); description = '' The compressor to use on the initrd image. May be any of: diff --git a/nixos/modules/system/boot/systemd/initrd.nix b/nixos/modules/system/boot/systemd/initrd.nix index 888653469ed7..8b3bbfdd2499 100644 --- a/nixos/modules/system/boot/systemd/initrd.nix +++ b/nixos/modules/system/boot/systemd/initrd.nix @@ -100,12 +100,6 @@ let fileSystems = filter utils.fsNeededForBoot config.system.build.fileSystems; - fstab = pkgs.writeText "initrd-fstab" (lib.concatMapStringsSep "\n" - ({ fsType, mountPoint, device, options, autoFormat, autoResize, ... }@fs: let - opts = options ++ optional autoFormat "x-systemd.makefs" ++ optional autoResize "x-systemd.growfs"; - finalDevice = if (lib.elem "bind" options) then "/sysroot${device}" else device; - in "${finalDevice} /sysroot${mountPoint} ${fsType} ${lib.concatStringsSep "," opts}") fileSystems); - needMakefs = lib.any (fs: fs.autoFormat) fileSystems; needGrowfs = lib.any (fs: fs.autoResize) fileSystems; @@ -354,8 +348,6 @@ in { DefaultEnvironment=PATH=/bin:/sbin ${optionalString (isBool cfg.emergencyAccess && cfg.emergencyAccess) "SYSTEMD_SULOGIN_FORCE=1"} ''; - "/etc/fstab".source = fstab; - "/lib/modules".source = "${modulesClosure}/lib/modules"; "/lib/firmware".source = "${modulesClosure}/lib/firmware"; diff --git a/nixos/modules/system/boot/systemd/shutdown.nix b/nixos/modules/system/boot/systemd/shutdown.nix index cb257dce6f04..5b190700c5d5 100644 --- a/nixos/modules/system/boot/systemd/shutdown.nix +++ b/nixos/modules/system/boot/systemd/shutdown.nix @@ -33,26 +33,30 @@ in { systemd.shutdownRamfs.contents."/shutdown".source = "${config.systemd.package}/lib/systemd/systemd-shutdown"; systemd.shutdownRamfs.storePaths = [pkgs.runtimeShell "${pkgs.coreutils}/bin"]; + systemd.mounts = [{ + what = "tmpfs"; + where = "/run/initramfs"; + type = "tmpfs"; + }]; + systemd.services.generate-shutdown-ramfs = { description = "Generate shutdown ramfs"; wantedBy = [ "shutdown.target" ]; before = [ "shutdown.target" ]; unitConfig = { DefaultDependencies = false; + RequiresMountsFor = "/run/initramfs"; ConditionFileIsExecutable = [ "!/run/initramfs/shutdown" ]; }; - path = [pkgs.util-linux pkgs.makeInitrdNGTool]; - serviceConfig.Type = "oneshot"; - script = '' - mkdir -p /run/initramfs - if ! mountpoint -q /run/initramfs; then - mount -t tmpfs tmpfs /run/initramfs - fi - make-initrd-ng ${ramfsContents} /run/initramfs - ''; + serviceConfig = { + Type = "oneshot"; + ProtectSystem = "strict"; + ReadWritePaths = "/run/initramfs"; + ExecStart = "${pkgs.makeInitrdNGTool}/bin/make-initrd-ng ${ramfsContents} /run/initramfs"; + }; }; }; } |