about summary refs log tree commit diff
path: root/machines
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2022-06-27 20:48:38 +0200
committerProfpatsch <mail@profpatsch.de>2022-06-27 20:48:38 +0200
commitf0274b2346a1203a918eaf58c418ed96f0a5d126 (patch)
tree2a3912480e0f39040ea4881db588434dd9b77452 /machines
parentf4083c40b6a312db6c293f345b556066523f5d49 (diff)
machines/leguin: ignore lid switch when connected
Diffstat (limited to 'machines')
-rw-r--r--machines/profpatsch/leguin.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/machines/profpatsch/leguin.nix b/machines/profpatsch/leguin.nix
index 2eb8f84b..7b1364ec 100644
--- a/machines/profpatsch/leguin.nix
+++ b/machines/profpatsch/leguin.nix
@@ -76,6 +76,20 @@ in
 
     };
 
+    services.logind.extraConfig = lib.generators.toKeyValue {} {
+
+      # I don’t want the machine to go off immediately
+      # when I accidentally touch the power button.
+      HandlePowerKey = "ignore";
+      HandlePowerKeyLongPress = "poweroff";
+
+      # as long as the machine is connected to power,
+      # it needs to be closed to preserve the monitor
+      HandleLidSwitchExternalPower = "ignore";
+      HandleLidSwitchDocked = "ignore";
+
+    };
+
     services.tailscale = {
       enable = true;
       interfaceName = tailscaleInterface;