nix: include git rev in build (#2688)

This commit is contained in:
Charlie Moog 2023-11-17 03:39:27 -06:00 committed by GitHub
parent 5aaaacbf47
commit f6215cfdaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@
systems.url = "github:nix-systems/default";
};
outputs = inputs@{ flake-parts, crane, nixpkgs, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
outputs = inputs@{ flake-parts, crane, nixpkgs, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [
@ -72,6 +72,12 @@
'';
GEN_ARTIFACTS = "artifacts";
TYPST_VERSION =
let
rev = self.shortRev or "dirty";
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version;
in
"${version} (${rev})";
meta.mainProgram = "typst";
});