summaryrefslogtreecommitdiff
path: root/hosts/skadhi
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/skadhi')
-rw-r--r--hosts/skadhi/default.nix30
-rw-r--r--hosts/skadhi/fs.nix4
2 files changed, 33 insertions, 1 deletions
diff --git a/hosts/skadhi/default.nix b/hosts/skadhi/default.nix
index 96138999..cf25777b 100644
--- a/hosts/skadhi/default.nix
+++ b/hosts/skadhi/default.nix
@@ -84,5 +84,35 @@
84 }; 84 };
85 85
86 services.openssh.enable = true; 86 services.openssh.enable = true;
87
88 services.logind.settings.Login = {
89 HandleLidSwitch = "sleep";
90 HandleLidSwitchExternalPower = "ignore";
91 };
92
93 systemd.timers.nix-gc = lib.mkForce {
94 timerConfig = {
95 RandomizedDelaySec = "12h";
96 Persistent = true;
97 OnCalendar = "*-*-* 18:00:00 Europe/Berlin";
98 };
99 wantedBy = [ "timers.target" ];
100 };
101 systemd.services.nix-gc = lib.mkForce {
102 description = "Nix Garbage Collector";
103 serviceConfig = {
104 Type = "oneshot";
105 ExecStart = pkgs.resholve.writeScript "nix-gc" {
106 interpreter = lib.getExe pkgs.zsh;
107 inputs = [ pkgs.coreutils config.nix.package ];
108 execer = [ "cannot:${lib.getExe' config.nix.package "nix-collect-garbage"}" ];
109 } ''
110 max_size=$(($(du -bs /nix/store | cut -f 1) - 1024**4))
111 [[ $max_size -gt 0 ]] || exit 0
112 exec nix-collect-garbage -vv --max-freed $max_size --delete-older-than 30d
113 '';
114 };
115 restartIfChanged = false;
116 };
87 }; 117 };
88} 118}
diff --git a/hosts/skadhi/fs.nix b/hosts/skadhi/fs.nix
index 1c423afa..41ef24f6 100644
--- a/hosts/skadhi/fs.nix
+++ b/hosts/skadhi/fs.nix
@@ -15,7 +15,9 @@
15 "/var/lib/nixos" 15 "/var/lib/nixos"
16 "/var/lib/sops-nix" 16 "/var/lib/sops-nix"
17 "/var/lib/systemd" 17 "/var/lib/systemd"
18 "/var/lib/fprintd" 18 "/var/lib/fprint"
19 "/var/lib/chrony"
20 "/var/lib/postfix"
19 config.boot.lanzaboote.pkiBundle 21 config.boot.lanzaboote.pkiBundle
20 ]; 22 ];
21 }; 23 };