authoravatarclover caruso<git@paperclover.net>2026-10-24 18:30:23-07:00
committeravatarclover caruso<git@paperclover.net>2026-10-24 19:01:23-07:00
log3164185b1168ea91cb83b28c2ff62555315780ff
treec90dfc747ae88cb3d14895b9a1522b3a2ed0cd9d
parentc5e52191dea81c828071dc071f3599ef90e16cf1
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

Prune old dashboard images daily

Every dashboard build leaves an image on the nearly full root disk. Pre-start reloads any release's image from the Nix store, so only images in use need to stay. Assisted-by: claude-opus-5.5

1 files changed, 15 insertions(+), 0 deletions(-)

nixos/configuration.nix+15
...@@ -178,6 +178,21 @@ in...@@ -178,6 +178,21 @@ in
178 RestartSec = 2;178 RestartSec = 2;
179 };179 };
180 };180 };
181 # Every dashboard build leaves an image; pre-start reloads any release's image from the Nix store.
182 systemd.timers.snowglobe-image-prune = {
183 wantedBy = [ "timers.target" ];
184 timerConfig = { OnCalendar = "daily"; Persistent = true; };
185 };
186 systemd.services.snowglobe-image-prune = {
187 path = [ pkgs.podman ];
188 serviceConfig.Type = "oneshot";
189 # rmi refuses images a container still uses.
190 script = ''
191 for image in $(podman images --quiet --filter reference=localhost/snowglobe-dashboard); do
192 podman rmi "$image" || true
193 done
194 '';
195 };
181 systemd.timers.snowglobe-vm-expiry = {196 systemd.timers.snowglobe-vm-expiry = {
182 wantedBy = [ "timers.target" ];197 wantedBy = [ "timers.target" ];
183 timerConfig = { OnBootSec = "1min"; OnUnitActiveSec = "1min"; };198 timerConfig = { OnBootSec = "1min"; OnUnitActiveSec = "1min"; };