nixos-config/shared/systemd.nix
2024-11-08 22:42:19 +01:00

29 lines
779 B
Nix

{ pkgs, lib, ... }:
{
systemd = {
# package = lib.mkDefault (nixpkgs-systemd-256.legacyPackages.x86_64-linux.systemd.override { withHomed = false; });
package = lib.mkDefault (pkgs.systemd.override { withHomed = false; });
sleep.extraConfig = ''
HibernateDelaySec=2h
'';
oomd = {
enable = true;
enableSystemSlice = true;
enableRootSlice = true;
enableUserSlices = true;
};
watchdog = {
runtimeTime = "30s";
rebootTime = "10m";
};
};
# https://github.com/NixOS/nixpkgs/pull/351151#issuecomment-2440083015
# fix hosts using impermanence
boot.initrd.systemd.suppressedUnits = [ "systemd-machine-id-commit.service" ];
systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ];
}