Merge pull request #55920 from matix2267/logind-lid-switch-external-power

nixos/logind: Add option for HandleLidSwitchExternalPower
This commit is contained in:
Ryan Mulligan 2019-02-16 22:01:14 -08:00 committed by GitHub
commit 55fa356613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}
'';