From 60aef1d03844072fab7d9d68c8a10340fe4f0bff Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 23 Apr 2024 16:00:16 +0200 Subject: [PATCH] ci: prevent nix garbage collection --- .forgejo/workflows/check.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 5b755270..f18c8bd2 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -48,13 +48,14 @@ jobs: - name: Run flake checks run: | - nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check - # Prevent cache garbage collection + # Prevent cache garbage collection by creating GC roots for target in $(nix flake show --json --all-systems | jq ' .["nixosConfigurations"] | to_entries[] | .key ' | tr -d '"' ); do - nix profile install --profile "/nix/var/nix/profiles/$target" ".#nixosConfigurations.${target}.config.system.build.toplevel" + nix --print-build-logs --verbose --accept-flake-config --access-tokens '' \ + build --out-link ./result-$target ".#nixosConfigurations.${target}.config.system.build.toplevel" done + nix --print-build-logs --verbose --accept-flake-config --access-tokens '' flake check