Merge pull request #1235 from jcollie/nix-full-version

Include the git commit hash in the Nix package.
This commit is contained in:
Mitchell Hashimoto
2024-01-06 10:50:29 -08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@ -31,6 +31,7 @@
};
outputs = {
self,
nixpkgs-unstable,
nixpkgs-stable,
nixpkgs-zig-0-12,
@ -54,6 +55,7 @@
packages.${system} = rec {
ghostty = pkgs-stable.callPackage ./nix/package.nix {
inherit (pkgs-zig-0-12) zig_0_12;
revision = self.shortRev or self.dirtyShortRev or "dirty";
};
default = ghostty;
};

View File

@ -1,4 +1,5 @@
{
self,
lib,
stdenv,
bzip2,
@ -23,6 +24,7 @@
ncurses,
pkg-config,
zig_0_12,
revision ? "dirty",
}: let
# The Zig hook has no way to select the release type without actual
# overriding of the default flags.
@ -121,7 +123,7 @@ in
dontConfigure = true;
zigBuildFlags = "-Dversion-string=${finalAttrs.version}";
zigBuildFlags = "-Dversion-string=${finalAttrs.version}-${revision}-nix";
preBuild = ''
rm -rf $ZIG_GLOBAL_CACHE_DIR