diff --git a/flake.nix b/flake.nix index 3a7afa3..d179a47 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,8 @@ # Common arguments can be set here to avoid repeating them later # Note: changes here will rebuild all dependency crates commonArgs = { + pname = "barbar"; + version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version; # Exclude build outputs regardless of git state (this repo is not # git-initialized, so cleanCargoSource would otherwise copy target/). src = pkgs.lib.cleanSourceWith { @@ -96,7 +98,9 @@ my-crate = craneLib.buildPackage ( commonArgs // { - cargoArtifacts = craneLib.buildDepsOnly commonArgs; + cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { + src = craneLib.cleanCargoSource ./.; + }); # Additional environment variables or build phases/hooks can be set # here *without* rebuilding all dependency crates