From e67afc23df2decd2c258e2ef0bf147ff1d986dae Mon Sep 17 00:00:00 2001 From: Tamipes Date: Mon, 12 Jan 2026 13:53:58 +0100 Subject: [PATCH] feat: don't rebuild dependencies(of the crate) if the hash changes It used to rebuild all of the dependencies of the crate, because I embed the hash in the program, and when commiting there is a new hash. ("revision" or "hash", it is just the git hash) Now it only rebuilds the final crate, so there is caching again. :) --- flake.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 3d72410..5dd2d1b 100644 --- a/flake.nix +++ b/flake.nix @@ -41,12 +41,6 @@ # Additional darwin specific inputs can be set here pkgs.libiconv ]; - - # Additional environment variables can be set directly - # MY_CUSTOM_VAR = "some value"; - COMMIT_HASH = builtins.substring 0 7 ( - if self ? rev then self.rev else "NoDHash" - ); }; craneLibLLvmTools = craneLib.overrideToolchain @@ -64,6 +58,12 @@ # artifacts from above. my-crate = craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; + + # Additional environment variables can be set directly + # MY_CUSTOM_VAR = "some value"; + COMMIT_HASH = builtins.substring 0 7 ( + if self ? rev then self.rev else "NoDHash" + ); }); in {