refactor: move logind config into systemd.nix
This commit is contained in:
parent
43a63d4f6e
commit
82133a8f16
|
@ -80,13 +80,6 @@
|
||||||
# - query details with `sudo cpupower frequency-info`
|
# - query details with `sudo cpupower frequency-info`
|
||||||
powerManagement.cpuFreqGovernor = "ondemand";
|
powerManagement.cpuFreqGovernor = "ondemand";
|
||||||
|
|
||||||
# see: `man logind.conf`
|
|
||||||
# don’t shutdown when power button is short-pressed (commonly done an accident, or by cats).
|
|
||||||
# but do on long-press: useful to gracefully power-off server.
|
|
||||||
services.logind.powerKey = "lock";
|
|
||||||
services.logind.powerKeyLongPress = "poweroff";
|
|
||||||
services.logind.lidSwitch = "lock";
|
|
||||||
|
|
||||||
# services.snapper.configs = {
|
# services.snapper.configs = {
|
||||||
# root = {
|
# root = {
|
||||||
# subvolume = "/";
|
# subvolume = "/";
|
||||||
|
|
|
@ -7,19 +7,6 @@ let
|
||||||
haltTimeout = 10;
|
haltTimeout = 10;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
systemd.extraConfig = ''
|
|
||||||
# DefaultTimeoutStopSec defaults to 90s, and frequently blocks overall system shutdown.
|
|
||||||
DefaultTimeoutStopSec=${builtins.toString haltTimeout}
|
|
||||||
'';
|
|
||||||
|
|
||||||
services.journald.extraConfig = ''
|
|
||||||
# docs: `man journald.conf`
|
|
||||||
# merged journald config is deployed to /etc/systemd/journald.conf
|
|
||||||
[Journal]
|
|
||||||
# disable journal compression because the underlying fs is compressed
|
|
||||||
Compress=no
|
|
||||||
'';
|
|
||||||
|
|
||||||
# allow ordinary users to `reboot` or `shutdown`.
|
# allow ordinary users to `reboot` or `shutdown`.
|
||||||
# source: <https://nixos.wiki/wiki/Polkit>
|
# source: <https://nixos.wiki/wiki/Polkit>
|
||||||
security.polkit.extraConfig = ''
|
security.polkit.extraConfig = ''
|
||||||
|
@ -38,4 +25,24 @@ in
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
services.journald.extraConfig = ''
|
||||||
|
# docs: `man journald.conf`
|
||||||
|
# merged journald config is deployed to /etc/systemd/journald.conf
|
||||||
|
[Journal]
|
||||||
|
# disable journal compression because the underlying fs is compressed
|
||||||
|
Compress=no
|
||||||
|
'';
|
||||||
|
|
||||||
|
# see: `man logind.conf`
|
||||||
|
# don’t shutdown when power button is short-pressed (commonly done an accident, or by cats).
|
||||||
|
# but do on long-press: useful to gracefully power-off server.
|
||||||
|
services.logind.powerKey = "lock";
|
||||||
|
services.logind.powerKeyLongPress = "poweroff";
|
||||||
|
services.logind.lidSwitch = "lock";
|
||||||
|
|
||||||
|
systemd.extraConfig = ''
|
||||||
|
# DefaultTimeoutStopSec defaults to 90s, and frequently blocks overall system shutdown.
|
||||||
|
DefaultTimeoutStopSec=${builtins.toString haltTimeout}
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user