all repos — nixfiles @ a846de8177cae01322f5f3af81e9ef64ecc963ba

System and user configuration, managed by nix and home-manager

bare-metal: automatically suspend when idle
Alan Pearce alan@alanpearce.eu
Thu, 16 Jun 2022 16:38:29 +0200
commit

a846de8177cae01322f5f3af81e9ef64ecc963ba

parent

a0f1382803a6c4ca93463928fef682346be9a894

1 files changed, 6 insertions(+), 0 deletions(-)

jump to
M system/settings/hardware/bare-metal.nixsystem/settings/hardware/bare-metal.nix
@@ -10,6 +10,12 @@ pciutils     usbutils
   ];
 
+  services.logind = {
+    extraConfig = ''
+      IdleAction=suspend
+      IdleActionSec=1800
+    '';
+  };
   services.udev.extraRules = ''
     # set scheduler for NVMe
     ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]", ATTR{queue/scheduler}="none"