1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 12:21:48 +02:00

nix flake metadata: Show flake fingerprint

This is useful for testing/debugging and maybe for sharing eval caches
(since it tells you what file in ~/.cache/nix/eval-cache-v5 to copy).

(cherry picked from commit 1ff186fc6e)
This commit is contained in:
Eelco Dolstra 2024-07-03 16:37:26 +02:00 committed by github-actions[bot]
parent 241c539f6f
commit e38f45b19f
3 changed files with 10 additions and 0 deletions

View file

@ -189,6 +189,7 @@ json=$(nix flake metadata flake1 --json | jq .)
[[ -d $(echo "$json" | jq -r .path) ]]
[[ $(echo "$json" | jq -r .lastModified) = $(git -C "$flake1Dir" log -n1 --format=%ct) ]]
hash1=$(echo "$json" | jq -r .revision)
[[ -n $(echo "$json" | jq -r .fingerprint) ]]
echo foo > "$flake1Dir/foo"
git -C "$flake1Dir" add $flake1Dir/foo