forked from colin/nix-files
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`
|
||||
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 = {
|
||||
# root = {
|
||||
# subvolume = "/";
|
||||
|
|
|
@ -7,19 +7,6 @@ let
|
|||
haltTimeout = 10;
|
||||
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`.
|
||||
# source: <https://nixos.wiki/wiki/Polkit>
|
||||
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