fixup all kinds of bugs

This commit is contained in:
steveej 2022-01-09 21:50:41 +01:00
parent 02bb843015
commit acc37c64f9
10 changed files with 45 additions and 31 deletions

View file

@ -3,6 +3,7 @@ set -xe
INFILE="${1:?Please set arg1 to INFILE}"
OUTFILE="${2:?Please set arg2 to OUTFILE}"
# sha256-1fm94N2Y9ptXVN6ni0nJyPRK+nsvoeliqBcFyjlaTH4=
hash=$(nix-build ${INFILE} --arg pkgs 'import <channels-nixos-stable> {}' --arg config 'null' 2>&1 | rg -o 'got.*(sha256-.{44})' -r '$1')
# sha256:0zjcb8wwl18pm1ifk89gggx4mx68r54qp9yyaibrpxlqvphbvyfm
hash=$(nix-build ${INFILE} --arg pkgs 'import <channels-nixos-stable> {}' --arg config 'null' 2>&1 | rg -o 'got.*(sha256[:-].+)$' -r '$1')
sed -E "s/0{52}/${hash}/" ${INFILE} > ${OUTFILE}