refactor: split systemd config into own file

This commit is contained in:
Colin 2024-02-20 12:18:28 +00:00
parent db49f0461c
commit 5fed127c23
2 changed files with 17 additions and 14 deletions

View File

@ -15,6 +15,7 @@
./programs
./secrets.nix
./ssh.nix
./systemd.nix
./users
];
@ -31,20 +32,6 @@
# time.timeZone = "America/Los_Angeles";
time.timeZone = "Etc/UTC"; # DST is too confusing for me => use a stable timezone
systemd.extraConfig = ''
# DefaultTimeoutStopSec defaults to 90s, and frequently blocks overall system shutdown.
# note that the values for the system manager and the user service manager must be set separately.
DefaultTimeoutStopSec=25
'';
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
'';
system.activationScripts.nixClosureDiff = {
supportsDryActivation = true;
text = ''

16
hosts/common/systemd.nix Normal file
View File

@ -0,0 +1,16 @@
{ ... }:
{
systemd.extraConfig = ''
# DefaultTimeoutStopSec defaults to 90s, and frequently blocks overall system shutdown.
# note that the values for the system manager and the user service manager must be set separately.
DefaultTimeoutStopSec=25
'';
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
'';
}