From 92a55af5c56ef5d5ce31ad9c2a75e79fab4a1f88 Mon Sep 17 00:00:00 2001 From: Defelo Date: Sat, 22 Feb 2025 10:14:21 +0100 Subject: [PATCH] niri: refactor --- pkgs/by-name/ni/niri/package.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/ni/niri/package.nix b/pkgs/by-name/ni/niri/package.nix index 4c83a0a3cdaf..ed5c9143c906 100644 --- a/pkgs/by-name/ni/niri/package.nix +++ b/pkgs/by-name/ni/niri/package.nix @@ -8,6 +8,7 @@ libinput, libxkbcommon, libgbm, + versionCheckHook, nix-update-script, pango, pipewire, @@ -22,14 +23,14 @@ withSystemd ? true, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "niri"; version = "25.02"; src = fetchFromGitHub { owner = "YaLTeR"; repo = "niri"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8="; }; @@ -106,6 +107,10 @@ rustPlatform.buildRustPackage rec { export XDG_RUNTIME_DIR=$(mktemp -d) ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + passthru = { providedSessions = [ "niri" ]; updateScript = nix-update-script { }; @@ -114,7 +119,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Scrollable-tiling Wayland compositor"; homepage = "https://github.com/YaLTeR/niri"; - changelog = "https://github.com/YaLTeR/niri/releases/tag/v${version}"; + changelog = "https://github.com/YaLTeR/niri/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ iogamaster @@ -125,4 +130,4 @@ rustPlatform.buildRustPackage rec { mainProgram = "niri"; platforms = lib.platforms.linux; }; -} +})