summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Moog <moogcharlie@gmail.com>2023-11-17 03:39:27 -0600
committerGitHub <noreply@github.com>2023-11-17 10:39:27 +0100
commitf6215cfdafdbbb63f85abeaf5e8948d8ab5717f3 (patch)
treea51abb58ea45a833e1171bb9d554decb15027395
parent5aaaacbf472fc71295d4e4a26615d941a4d92a00 (diff)
nix: include git rev in build (#2688)
-rw-r--r--flake.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 0033641a..627ee307 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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";
});