all repos — nixfiles @ 8b52a21a0493f8e822f2531ebaef50e261b70116

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

laptop: configure lid power actions
Alan Pearce alan@alanpearce.eu
Fri, 24 Jan 2020 14:28:41 +0100
commit

8b52a21a0493f8e822f2531ebaef50e261b70116

parent

65af77332cf92701f177721dd01a60ff2a6566c4

1 files changed, 8 insertions(+), 4 deletions(-)

jump to
M system/settings/hardware/laptop.nixsystem/settings/hardware/laptop.nix
@@ -41,10 +41,14 @@ source = ../../autorandr;     target = "xdg/autorandr";
   };
 
-  services.logind.extraConfig = ''
-    IdleAction=suspend
-    IdleActionSec=600
-  '';
+  services.logind = {
+    lidSwitch = "suspend";
+    lidSwitchExternalPower = "ignore";
+    extraConfig = ''
+      IdleAction=suspend
+      IdleActionSec=600
+    '';
+  };
 
   services.acpid = {
     enable = true;