diff --git a/flake.nix b/flake.nix index 16ce37b1..2675b303 100644 --- a/flake.nix +++ b/flake.nix @@ -17,17 +17,16 @@ outputs = { self, nixpkgs, flake-utils, crane, rust-overlay, ... }: let - git_version = self.lastModifiedDate; compile = import ./nix/compile.nix; in flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; packageFor = target: release: (compile { - inherit system git_version target nixpkgs crane rust-overlay release; + inherit system target nixpkgs crane rust-overlay release; }).garage; testWith = extraTestEnv: (compile { - inherit system git_version nixpkgs crane rust-overlay extraTestEnv; + inherit system nixpkgs crane rust-overlay extraTestEnv; release = false; }).garage-test; in @@ -59,7 +58,7 @@ devShells = let targets = compile { - inherit system git_version nixpkgs crane rust-overlay; + inherit system nixpkgs crane rust-overlay; }; in { diff --git a/nix/compile.nix b/nix/compile.nix index 83ea8240..1e1bbb38 100644 --- a/nix/compile.nix +++ b/nix/compile.nix @@ -6,7 +6,7 @@ /* parameters */ system, - git_version ? "unknown", + git_version ? null, target ? null, release ? false, features ? null, @@ -110,7 +110,7 @@ let { inherit src; pname = "garage"; - version = "none"; + version = "dev"; strictDeps = true; cargoExtraArgs = "--locked --features ${featuresStr}"; @@ -167,9 +167,11 @@ in rec { cargoArtifacts = garage-deps; doCheck = false; - version = git_version; - GIT_VERSION = git_version; - }); + } // + (if git_version != null then { + version = git_version; + GIT_VERSION = git_version; + } else {})); garage-test-deps = craneLib.buildDepsOnly (testArgs // { cargoArtifacts = garage;