···
15
-
services.logind.extraConfig = mkOption {
14
+
options.services.logind = {
15
+
extraConfig = mkOption {
example = "IdleAction=lock";
description = lib.mdDoc ''
20
-
Extra config options for systemd-logind. See
22
-
logind.conf(5)](https://www.freedesktop.org/software/systemd/man/logind.conf.html) for available options.
20
+
Extra config options for systemd-logind.
21
+
See [logind.conf(5)](https://www.freedesktop.org/software/systemd/man/logind.conf.html)
22
+
for available options.
26
-
services.logind.killUserProcesses = mkOption {
26
+
killUserProcesses = mkOption {
description = lib.mdDoc ''
Specifies whether the processes of a user should be killed
when the user logs out. If true, the scope unit corresponding
to the session and all processes inside that scope will be
33
-
terminated. If false, the scope is "abandoned" (see
34
-
[systemd.scope(5)](https://www.freedesktop.org/software/systemd/man/systemd.scope.html#)), and processes are not killed.
33
+
terminated. If false, the scope is "abandoned"
34
+
(see [systemd.scope(5)](https://www.freedesktop.org/software/systemd/man/systemd.scope.html#)),
35
+
and processes are not killed.
See [logind.conf(5)](https://www.freedesktop.org/software/systemd/man/logind.conf.html#KillUserProcesses=)
41
-
services.logind.lidSwitch = mkOption {
42
+
powerKey = mkOption {
43
+
default = "poweroff";
45
+
type = logindHandlerType;
47
+
description = lib.mdDoc ''
48
+
Specifies what to do when the power key is pressed.
52
+
powerKeyLongPress = mkOption {
55
+
type = logindHandlerType;
57
+
description = lib.mdDoc ''
58
+
Specifies what to do when the power key is long-pressed.
62
+
rebootKey = mkOption {
65
+
type = logindHandlerType;
67
+
description = lib.mdDoc ''
68
+
Specifies what to do when the reboot key is pressed.
72
+
rebootKeyLongPress = mkOption {
73
+
default = "poweroff";
75
+
type = logindHandlerType;
77
+
description = lib.mdDoc ''
78
+
Specifies what to do when the reboot key is long-pressed.
82
+
suspendKey = mkOption {
type = logindHandlerType;
description = lib.mdDoc ''
47
-
Specifies what to be done when the laptop lid is closed.
88
+
Specifies what to do when the suspend key is pressed.
92
+
suspendKeyLongPress = mkOption {
93
+
default = "hibernate";
95
+
type = logindHandlerType;
97
+
description = lib.mdDoc ''
98
+
Specifies what to do when the suspend key is long-pressed.
102
+
hibernateKey = mkOption {
103
+
default = "hibernate";
104
+
example = "ignore";
105
+
type = logindHandlerType;
107
+
description = lib.mdDoc ''
108
+
Specifies what to do when the hibernate key is pressed.
51
-
services.logind.lidSwitchDocked = mkOption {
112
+
hibernateKeyLongPress = mkOption {
type = logindHandlerType;
description = lib.mdDoc ''
57
-
Specifies what to be done when the laptop lid is closed
58
-
and another screen is added.
118
+
Specifies what to do when the hibernate key is long-pressed.
62
-
services.logind.lidSwitchExternalPower = mkOption {
122
+
lidSwitch = mkOption {
123
+
default = "suspend";
124
+
example = "ignore";
125
+
type = logindHandlerType;
127
+
description = lib.mdDoc ''
128
+
Specifies what to do when the laptop lid is closed.
132
+
lidSwitchExternalPower = mkOption {
defaultText = literalExpression "services.logind.lidSwitch";
type = logindHandlerType;
description = lib.mdDoc ''
69
-
Specifies what to do when the laptop lid is closed and the system is
70
-
on external power. By default use the same action as specified in
71
-
services.logind.lidSwitch.
139
+
Specifies what to do when the laptop lid is closed
140
+
and the system is on external power. By default use
141
+
the same action as specified in services.logind.lidSwitch.
145
+
lidSwitchDocked = mkOption {
146
+
default = "ignore";
147
+
example = "suspend";
148
+
type = logindHandlerType;
150
+
description = lib.mdDoc ''
151
+
Specifies what to do when the laptop lid is closed
152
+
and another screen is added.
···
"systemd/logind.conf".text = ''
KillUserProcesses=${if cfg.killUserProcesses then "yes" else "no"}
178
+
HandlePowerKey=${cfg.powerKey}
179
+
HandlePowerKeyLongPress=${cfg.powerKeyLongPress}
180
+
HandleRebootKey=${cfg.rebootKey}
181
+
HandleRebootKeyLongPress=${cfg.rebootKeyLongPress}
182
+
HandleSuspendKey=${cfg.suspendKey}
183
+
HandleSuspendKeyLongPress=${cfg.suspendKeyLongPress}
184
+
HandleHibernateKey=${cfg.hibernateKey}
185
+
HandleHibernateKeyLongPress=${cfg.hibernateKeyLongPress}
HandleLidSwitch=${cfg.lidSwitch}
98
-
HandleLidSwitchDocked=${cfg.lidSwitchDocked}
HandleLidSwitchExternalPower=${cfg.lidSwitchExternalPower}
188
+
HandleLidSwitchDocked=${cfg.lidSwitchDocked}