From cfd3861ca11a962b45d9f5945d615f0f2915698c Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Wed, 8 Oct 2025 21:26:07 +0000 Subject: [PATCH] fix(spindle): auto-prune docker Change-Id: vmoyyttlzwwowulzutwmntpzmolmkmmv Spindle has an issue where it sometimes (particularly after failures) leaks docker resources. Therefore, we should prune them. We shouldn't prune images automatically because these are commonly used between workflows, so we need to override the autoprune service to only prune the stuff we want... --- packetmix/systems/midnight/spindle.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packetmix/systems/midnight/spindle.nix b/packetmix/systems/midnight/spindle.nix index 075e5197..0993fcdd 100644 --- a/packetmix/systems/midnight/spindle.nix +++ b/packetmix/systems/midnight/spindle.nix @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: MIT -{ project, ... }: +{ project, pkgs, lib, ... }: { imports = [ project.inputs.tangled.result.nixosModules.spindle ]; @@ -19,6 +19,15 @@ pipelines.workflowTimeout = "2h"; }; + virtualisation.docker.autoPrune = { + enable = true; + dates = "hourly"; + }; + systemd.services.docker-prune.serviceConfig.ExecStart = lib.mkForce '' + ${pkgs.docker}/bin/docker network prune -f ;\ + ${pkgs.docker}/bin/docker container prune -f + ''; + clicks.storage.impermanence.persist.directories = [ "/var/lib/docker" "/var/lib/spindle" -- 2.43.0