Merge pull request #25971 from Ma27/systemd/logind-config
services.logind: add options for lid-switch behavior
This commit is contained in:
commit
2d12d2b70e
@ -396,6 +396,11 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
logindHandlerType = types.enum [
|
||||||
|
"ignore" "poweroff" "reboot" "halt" "kexec" "suspend"
|
||||||
|
"hibernate" "hybrid-sleep" "lock"
|
||||||
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -595,6 +600,27 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.logind.lidSwitch = mkOption {
|
||||||
|
default = "suspend";
|
||||||
|
example = "ignore";
|
||||||
|
type = logindHandlerType;
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Specifies what to be done when the laptop lid is closed.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.logind.lidSwitchDocked = mkOption {
|
||||||
|
default = "ignore";
|
||||||
|
example = "suspend";
|
||||||
|
type = logindHandlerType;
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Specifies what to be done when the laptop lid is closed
|
||||||
|
and another screen is added.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
systemd.user.extraConfig = mkOption {
|
systemd.user.extraConfig = mkOption {
|
||||||
default = "";
|
default = "";
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
@ -721,6 +747,8 @@ in
|
|||||||
"systemd/logind.conf".text = ''
|
"systemd/logind.conf".text = ''
|
||||||
[Login]
|
[Login]
|
||||||
KillUserProcesses=no
|
KillUserProcesses=no
|
||||||
|
HandleLidSwitch=${config.services.logind.lidSwitch}
|
||||||
|
HandleLidSwitchDocked=${config.services.logind.lidSwitchDocked}
|
||||||
${config.services.logind.extraConfig}
|
${config.services.logind.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user