summary refs log tree commit diff
path: root/pkgs/applications/terminal-emulators/foot/default.nix
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-10-06 11:42:03 +0200
committersterni <sternenseemann@systemli.org>2021-10-07 16:18:59 +0200
commit9a76986ee0d46ea8074c9a8992df531dd90ac261 (patch)
tree130ebf92404a024c0f2df881ce7ece6967697000 /pkgs/applications/terminal-emulators/foot/default.nix
parent6bfc5e94f60751aaf5f83e3ffad2cbf51afc9a98 (diff)
downloadnixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar.gz
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar.bz2
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar.lz
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar.xz
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.tar.zst
nixpkgs-9a76986ee0d46ea8074c9a8992df531dd90ac261.zip
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.
Diffstat (limited to 'pkgs/applications/terminal-emulators/foot/default.nix')
-rw-r--r--pkgs/applications/terminal-emulators/foot/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/applications/terminal-emulators/foot/default.nix b/pkgs/applications/terminal-emulators/foot/default.nix
index f9fea74c113..837b2b45a39 100644
--- a/pkgs/applications/terminal-emulators/foot/default.nix
+++ b/pkgs/applications/terminal-emulators/foot/default.nix
@@ -36,8 +36,7 @@ let
   #
   # For every bump, make sure that the hash is still accurate.
   stimulusGenerator = stdenv.mkDerivation {
-    pname = "foot-generate-alt-random-writes";
-    inherit version;
+    name = "foot-generate-alt-random-writes";
 
     src = fetchurl {
       url = "https://codeberg.org/dnkl/foot/raw/tag/${version}/scripts/generate-alt-random-writes.py";
@@ -185,6 +184,13 @@ stdenv.mkDerivation rec {
     noPgo = foot.override {
       allowPgo = false;
     };
+
+    # By changing name, this will get rebuilt everytime we change version,
+    # even if the hash stays the same. Consequently it'll fail if we introduce
+    # a hash mismatch when updating.
+    stimulus-script-is-current = stimulusGenerator.src.overrideAttrs (_: {
+      name = "generate-alt-random-writes-${version}.py";
+    });
   };
 
   meta = with lib; {