add output diffs

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2024-07-04 00:33:54 -04:00
committed by Alice Huston
parent 6d41203f89
commit 042732b15d
4 changed files with 77 additions and 0 deletions

21
utils/eval-to-drv.sh Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env nix
#! nix shell nixpkgs#bash nixpkgs#gnugrep --command bash
# diffs each derivation
set -x
set -v
set -e
if [ "$#" -ne 2 ]; then
echo "$0 (pre|post)"
fi
script_path=$(dirname "$(readlink -f $0)")
parent_path=$(dirname "$script_path")
out_path="$parent_path/$1-drv"
drv=$(nix flake check --verbose 2> >(grep -P -o "derivation evaluated to (/nix/store/.*\.drv)" | grep -P -o "/nix/store/.*\.drv"))
echo "$drv" > "$out_path"