2024-07-04 00:33:54 -04:00
|
|
|
#!/usr/bin/env nix
|
2024-07-04 01:20:24 -04:00
|
|
|
#! nix shell nixpkgs#bash nixpkgs#gnugrep nixpkgs#nixVersions.latest --command bash
|
2024-07-04 00:33:54 -04:00
|
|
|
|
|
|
|
# diffs each derivation
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -v
|
|
|
|
set -e
|
|
|
|
|
2024-07-04 01:20:24 -04:00
|
|
|
if [ "$#" -ne 1 ]; then
|
2024-07-04 00:33:54 -04:00
|
|
|
echo "$0 (pre|post)"
|
2024-07-04 01:20:24 -04:00
|
|
|
exit 1
|
2024-07-04 00:33:54 -04:00
|
|
|
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"
|