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:
parent
241c539f6f
commit
e38f45b19f
3 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue