diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 38b6865e..7a035990 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -43,6 +43,24 @@ # does the builder use some content-addressed db to efficiently dedupe? nix.settings.auto-optimise-store = true; + systemd.services.nix-daemon.serviceConfig = { + # the nix-daemon manages nix builders + # kill nix-daemon subprocesses when systemd-oomd detects an out-of-memory condition + # see: + # - nixos PR that enabled systemd-oomd: + # - systemd's docs on these properties: + # + # systemd's docs warn that without swap, systemd-oomd might not be able to react quick enough to save the system. + # see `man oomd.conf` for further tunables that may help. + # + # alternatively, apply this more broadly with `systemd.oomd.enableSystemSlice = true` or `enableRootSlice` + # TODO: also apply this to the guest user's slice (user-1100.slice) + # TODO: also apply this to distccd + ManagedOOMMemoryPressure = "kill"; + ManagedOOMSwap = "kill"; + }; + + # TODO: move this to gui machines only fonts = { enableDefaultFonts = true; fonts = with pkgs; [ font-awesome noto-fonts-emoji hack-font ];