From e6f0a1e7ebceac4e25150384008f5b051aa8be03 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sat, 22 Feb 2020 12:43:06 +0100 Subject: [PATCH 1/3] undervolt: apply undervolt on boot and resume The undervolt did not persist reboots or sleep/hibernation. With this change you should no longer have to apply the undervolt on a timer --- nixos/modules/services/hardware/undervolt.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/services/hardware/undervolt.nix b/nixos/modules/services/hardware/undervolt.nix index 828032dc573a..1f1a6d674787 100644 --- a/nixos/modules/services/hardware/undervolt.nix +++ b/nixos/modules/services/hardware/undervolt.nix @@ -114,6 +114,11 @@ in path = [ pkgs.undervolt ]; description = "Intel Undervolting Service"; + + # Apply undervolt on boot, nixos generation switch and resume + wantedBy = [ "multi-user.target" "post-resume.target" ]; + after = [ "post-resume.target" ]; # Not sure why but it won't work without this + serviceConfig = { Type = "oneshot"; Restart = "no"; From ed83bac1d98aa3818331685d968444dbda66dc28 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sat, 22 Feb 2020 12:45:47 +0100 Subject: [PATCH 2/3] undervolt: make timer opt-in It should no longer be needed but is worth keeping around in case it is --- nixos/modules/services/hardware/undervolt.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/hardware/undervolt.nix b/nixos/modules/services/hardware/undervolt.nix index 1f1a6d674787..054ffa35050a 100644 --- a/nixos/modules/services/hardware/undervolt.nix +++ b/nixos/modules/services/hardware/undervolt.nix @@ -103,6 +103,17 @@ in The temperature target on battery power in Celsius degrees. ''; }; + + useTimer = mkOption { + type = types.bool; + default = false; + description = '' + Whether to set a timer that applies the undervolt settings every 30s. + This will cause spam in the journal but might be required for some + hardware under specific conditions. + Enable this if your undervolt settings don't hold. + ''; + }; }; config = mkIf cfg.enable { @@ -126,7 +137,7 @@ in }; }; - systemd.timers.undervolt = { + systemd.timers.undervolt = mkIf cfg.useTimer { description = "Undervolt timer to ensure voltage settings are always applied"; partOf = [ "undervolt.service" ]; wantedBy = [ "multi-user.target" ]; From f5856db1b83671bae5dc9886f23c3612498a1246 Mon Sep 17 00:00:00 2001 From: Atemu Date: Wed, 13 May 2020 10:47:16 +0200 Subject: [PATCH 3/3] rl-2009: add note on undervolt timer changes --- nixos/doc/manual/release-notes/rl-2009.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index 59a4d78c27e4..592aa3dcaf4d 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -910,6 +910,13 @@ services.transmission.settings.rpc-bind-address = "0.0.0.0"; The packages perl, rsync and strace were removed from . If you need them, install them again with = with pkgs; [ perl rsync strace ]; in your configuration.nix. + + + The undervolt option no longer needs to apply its + settings every 30s. If they still become undone, open an issue and restore + the previous behaviour using undervolt.useTimer. + +