foot: cache stimuliFile more aggressively

stimuliFile would get rebuild with every change in version, since the
stimulusGenerator derivation would depend on the version string. Since
the script often doesn't change between releases, this causes
unnecessary rebuilds and cache duplication.

Additionally we add a test to passthru which checks if the hash of the
script is still up to date: By making its name depend on the version
string, it'll get rebuild on every version change, even if the hash
stays the same. This way we can detect new hash mismatches.

+8 -2
+8 -2
pkgs/applications/terminal-emulators/foot/default.nix
··· 36 36 # 37 37 # For every bump, make sure that the hash is still accurate. 38 38 stimulusGenerator = stdenv.mkDerivation { 39 - pname = "foot-generate-alt-random-writes"; 40 - inherit version; 39 + name = "foot-generate-alt-random-writes"; 41 40 42 41 src = fetchurl { 43 42 url = "https://codeberg.org/dnkl/foot/raw/tag/${version}/scripts/generate-alt-random-writes.py"; ··· 185 184 noPgo = foot.override { 186 185 allowPgo = false; 187 186 }; 187 + 188 + # By changing name, this will get rebuilt everytime we change version, 189 + # even if the hash stays the same. Consequently it'll fail if we introduce 190 + # a hash mismatch when updating. 191 + stimulus-script-is-current = stimulusGenerator.src.overrideAttrs (_: { 192 + name = "generate-alt-random-writes-${version}.py"; 193 + }); 188 194 }; 189 195 190 196 meta = with lib; {