From 7bfaf6479d0978be1675bd62899c05f15488bcef Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 31 Oct 2026 16:34:18 -0700 Subject: [PATCH] perf(nix): stamp the commit only into the final macOS package As for Windows and KDE: COMMIT_HASH was in the kfm commonArgs, so buildDepsOnly (about 1000 dependencies) and every kfm check got a new derivation for every commit and rebuilt in full on the Mac. commonArgs now has the constant "nix-check"; only fullBuild, and so packages.default and the extracted binaries, gets the real commit. Verified: the darwin clippy, nextest and deps attributes cannot be evaluated on this Linux host (a derivation of the stub source has to be built), so the drvPath table of the other attributes is the evidence; see the report. Needs a Mac build: after one cold build of the clippy check, a docs-only commit must be a cache hit. --- komorebi-for-mac/flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/komorebi-for-mac/flake.nix b/komorebi-for-mac/flake.nix index 82634cc6..4ca2e262 100644 --- a/komorebi-for-mac/flake.nix +++ b/komorebi-for-mac/flake.nix @@ -143,7 +143,9 @@ cargoExtraArgs = "--locked ${packages}"; inherit src version; strictDeps = true; - COMMIT_HASH = self.rev or (pkgs.lib.removeSuffix "-dirty" (self.dirtyRev or "unknown")); + # a constant, so that the dependencies and every check are the same derivations for + # every commit; only fullBuild stamps the real one + COMMIT_HASH = "nix-check"; nativeBuildInputs = [ pkgs.darwin.cctools ]; @@ -171,6 +173,7 @@ individualCrateArgs // { pname = "komorebi-workspace"; + COMMIT_HASH = self.rev or (pkgs.lib.removeSuffix "-dirty" (self.dirtyRev or "unknown")); } );