From a2e04a919c75aafac26d47dc3eeeaeac1fe4218f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 18 Sep 2025 08:46:17 +0200 Subject: [PATCH] build: fix computation of Nix hash for pnpm deps We have to put a fake hash as pnpmDeps does not fail on change when the hash is known. --- flake.nix | 6 ++++-- nix/npmDepsHash.txt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 34c3c105..67f0243d 100644 --- a/flake.nix +++ b/flake.nix @@ -97,9 +97,11 @@ [[ -z "$sha256" ]] || echo $sha256 > nix/vendorHash.txt ''; update-npmDepsHash = '' - sha256=$(2>&1 nix build --no-link .#frontend.npmDeps \ + oldSha256=$(cat nix/npmDepsHash.txt) + echo sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= > nix/npmDepsHash.txt + sha256=$(2>&1 nix build --no-link .#frontend.pnpmDeps \ | ${pkgs.gnused}/bin/sed -nE "s/\s+got:\s+(sha256-.*)/\1/p") - [[ -z "$sha256" ]] || echo $sha256 > nix/npmDepsHash.txt + [[ -z "$sha256" ]] && echo $oldSha256 || echo $sha256 > nix/npmDepsHash.txt ''; update-ianaServiceNamesHash = '' sha256=$(2>&1 nix build --no-link .#ianaServiceNames \ diff --git a/nix/npmDepsHash.txt b/nix/npmDepsHash.txt index b869f322..e47b0fb2 100644 --- a/nix/npmDepsHash.txt +++ b/nix/npmDepsHash.txt @@ -1 +1 @@ -sha256-4h48BXKE5yY7ZLkW2xYzybuSi6OZDVH7ziCEMfaiPIo= +sha256-01e9HjMU/iGjWw2JoAYcI/hnNm9TEff4codrbe5Dp64=