From adea4bd9e59f1f9c4452f11d72c37221cf2b3d2d Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Tue, 25 Aug 2026 08:46:45 +0100 Subject: [PATCH] ci/cache: Prune profile generations Explicitly remove expired generations from the nonstandard Harmonia profile before collecting garbage. This keeps old CI closures from remaining rooted until the cache exhausts its inodes. --- ci/push-to-cache.sh | 5 ++++- docs/deployment.md | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/push-to-cache.sh b/ci/push-to-cache.sh index 30a1fa5..f108373 100755 --- a/ci/push-to-cache.sh +++ b/ci/push-to-cache.sh @@ -12,7 +12,10 @@ remote_cmd() { collect_garbage() { echo "Collecting garbage..." - remote_cmd nix-collect-garbage --delete-older-than 60d + remote_cmd nix-env \ + -p "$REMOTE_STORE"/nix/var/nix/profiles/nixfiles \ + --delete-generations 60d + remote_cmd nix-collect-garbage } umask_old=$(umask) diff --git a/docs/deployment.md b/docs/deployment.md index 040dde0..9f5feb4 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -223,8 +223,8 @@ Harmonia substituter as the boxes), runs `nix flake check --no-build`, then buil of `.#ci.x86_64-linux`: systems as `system-`, homes as `home-` (with `@` changed to `-at-`), packages as `package-`, and the development `shell`. Each result is pushed to the Harmonia cache with [`ci/push-to-cache.sh`](../ci/push-to-cache.sh). Before the first push, the -workflow collects cache paths older than its retention period so a full cache cannot prevent -collection from being reached. +workflow deletes cache-profile generations older than its retention period, then collects +unreachable paths so a full cache cannot prevent collection from being reached. It then builds `.#ciDrv.x86_64-linux`, a `linkFarm` of all CI attributes, and pushes it with `UPDATE_PROFILE=1`. That updates the `nixfiles` profile on the cache box and collects old paths