5 lines
276 B
Bash
Executable file
5 lines
276 B
Bash
Executable file
#!/usr/bin/env bash
|
|
INFILE="${1:?Please set arg1 to INFILE}"
|
|
OUTFILE="${2:?Please set arg2 to OUTFILE}"
|
|
hash=$(nix-build ${INFILE} --arg pkgs 'import <nixpkgs> {}' --arg config 'null' 2>&1 | grep -oE '[0-9a-z]{52}' | head -n1)
|
|
sed -E "s/0{52}/${hash}/" ${INFILE} > ${OUTFILE}
|