about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2019-02-16 22:01:14 -0800
committerGitHub <noreply@github.com>2019-02-16 22:01:14 -0800
commit55fa35661386729951ece670e1f6823f2059e3c2 (patch)
treef73dcd992567ee4ee6641971fef45dc4e3560972 /nixos
parent97858b8a79886fe11739abf191d9978c9031b8a3 (diff)
parentfb9619ca03f4057c8a03daa131bd8ba8fa5a48cb (diff)
Merge pull request #55920 from matix2267/logind-lid-switch-external-power
nixos/logind: Add option for HandleLidSwitchExternalPower
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/systemd.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 58812bf33d9b6..9fdef0251d70f 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -650,6 +650,18 @@ in
       '';
     };
 
+    services.logind.lidSwitchExternalPower = mkOption {
+      default = config.services.logind.lidSwitch;
+      example = "ignore";
+      type = logindHandlerType;
+
+      description = ''
+        Specifies what to do when the laptop lid is closed and the system is
+        on external power. By default use the same action as specified in
+        services.logind.lidSwitch.
+      '';
+    };
+
     systemd.user.extraConfig = mkOption {
       default = "";
       type = types.lines;
@@ -797,6 +809,7 @@ in
         KillUserProcesses=${if config.services.logind.killUserProcesses then "yes" else "no"}
         HandleLidSwitch=${config.services.logind.lidSwitch}
         HandleLidSwitchDocked=${config.services.logind.lidSwitchDocked}
+        HandleLidSwitchExternalPower=${config.services.logind.lidSwitchExternalPower}
         ${config.services.logind.extraConfig}
       '';