ci: prevent flake inputs from GC as well
Flake checks / Check (pull_request) Successful in 5m30s Details

teutat3s 2024-04-23 16:32:11 +02:00
parent 60aef1d038
commit a53177b7e0
Signed by: teutat3s
GPG Key ID: 4FA1D3FA524F22C1
1 changed files with 11 additions and 0 deletions

View File

@ -58,4 +58,15 @@ jobs:
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
# Add GC roots for flake inputs, too
# https://github.com/NixOS/nix/issues/4250#issuecomment-1146878407
nix_profile_dir="$USER"/.nix-profile
mkdir --parents "$nix_profile_dir"
gc_root_prefix="$nix_profile_dir"/infra-flake-
echo "Adding gcroots flake inputs with prefix $gc_root_prefix ..."
nix flake archive --json 2>/dev/null | jq --raw-output '.inputs | to_entries[] | "ln --force --symbolic --no-target-directory "+.value.path+" \"'"$gc_root_prefix"'"+.key+"\""' | while read -r line; do
eval "$line"
done