nixpkgs/pkgs/build-support/setup-hooks/reproducible-builds.sh
Yureka e1f1c7eb79
Revert "setup-hooks/reproducible-builds.sh: NIX_OUTPATH_USED_AS_RANDOM_SEED" (#216935)
This is a stdenv rebuild and should have gone to staging
2023-02-18 11:33:13 +01:00

10 lines
433 B
Bash

# Use the last part of the out path as hash input for the build.
# This should ensure that it is deterministic across rebuilds of the same
# derivation and not easily collide with other builds.
# We also truncate the hash so that it cannot cause reference cycles.
NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE:-} -frandom-seed=$(
outbase="${out##*/}"
randomseed="${outbase:0:10}"
echo $randomseed
)"
export NIX_CFLAGS_COMPILE