Unverified Commit f2352c2c authored by Leah Amelia Chen's avatar Leah Amelia Chen
Browse files

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
parent d8332aa3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 ];