| ... | @@ -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"; }; |