diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index e86e39e86b90..62c71bd7c46a 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -211,6 +211,8 @@ See . - [services.resolved](#opt-services.resolved.enable) module was converted to RFC42-style settings. The moved options have also been renamed to match the upstream names. Aliases mean current configs will continue to function, but users should move to the new options as convenient. +- `systemd.sleep.extraConfig` was replaced by [RFC 0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md)-compliant `systemd.sleep.settings.Sleep`, which is used to generate the `sleep.conf` configuration file. See {manpage}`sleep.conf.d(5)` for available options. + - Support for Bluetooth audio based on `bluez-alsa` has been added to the `hardware.alsa` module. It can be enabled with the new [enableBluetooth](#opt-hardware.alsa.enableBluetooth) option. - `services.openssh` now supports generating host SSH keys by setting `services.openssh.generateHostKeys = true` while leaving `services.openssh.enable` disabled. This is particularly useful for systems that have no need of an SSH daemon but want SSH host keys for other purposes such as using agenix or sops-nix. diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 8bfd2a784f47..c5e6b28ae78d 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -470,13 +470,17 @@ in ''; }; - sleep.extraConfig = mkOption { - default = ""; - type = types.lines; - example = "HibernateDelaySec=1h"; + sleep.settings.Sleep = mkOption { + default = { }; + type = lib.types.submodule { + freeformType = types.attrsOf unitOption; + }; + example = { + HibernateDelaySec = "1h"; + }; description = '' - Extra config options for systemd sleep state logic. - See {manpage}`sleep.conf.d(5)` man page for available options. + Options for systemd sleep state logic. See {manpage}`sleep.conf.d(5)` man page + for available options. ''; }; @@ -637,10 +641,7 @@ in "systemd/system.conf".text = settingsToSections cfg.settings; - "systemd/sleep.conf".text = '' - [Sleep] - ${cfg.sleep.extraConfig} - ''; + "systemd/sleep.conf".text = settingsToSections cfg.sleep.settings; "systemd/user-generators" = { source = hooks "user-generators" cfg.user.generators; @@ -878,6 +879,11 @@ in NixOS does not officially support this configuration and might cause your system to be unbootable in future versions. You are on your own. '') (mkRemovedOptionModule [ "systemd" "extraConfig" ] "Use systemd.settings.Manager instead.") + (mkRemovedOptionModule [ + "systemd" + "sleep" + "extraConfig" + ] "Use systemd.sleep.settings.Sleep instead.") (lib.mkRenamedOptionModule [ "systemd" "watchdog" "device" ] [ "systemd" "settings" "Manager" "WatchdogDevice" ]