From f2352c2c8ba730084405bd714f1a6eb0792e5dec Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Wed, 18 Jun 2025 14:25:23 +0200 Subject: [PATCH] niri: explicitly set commit hash to "Nixpkgs" Upstream recommends[^1] that in build environments where the Git history is not available, packagers should manually set the commit hash. Given that currently in Nixpkgs we don't have a great way of obtaining the hash through the usual fetchers and update scripts, we could just set it to "Nixpkgs" for now, to indicate to the user that their Niri binary is built from Nixpkgs and not from source, for example. [^1]: https://github.com/YaLTeR/niri/wiki/Packaging-niri#version-string --- pkgs/by-name/ni/niri/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ni/niri/package.nix b/pkgs/by-name/ni/niri/package.nix index 3c473ac59cd2..6fd08908d0d7 100644 --- a/pkgs/by-name/ni/niri/package.nix +++ b/pkgs/by-name/ni/niri/package.nix @@ -110,6 +110,11 @@ rustPlatform.buildRustPackage (finalAttrs: { "-Wl,--pop-state" ] ); + + # Upstream recommends setting the commit hash manually when in a + # build environment where the Git repository is unavailable. + # See https://github.com/YaLTeR/niri/wiki/Packaging-niri#version-string + NIRI_BUILD_COMMIT = "Nixpkgs"; }; nativeInstallCheckInputs = [ versionCheckHook ];