From 61ffcdafa9fe5f4e1237346ae521c038458254e5 Mon Sep 17 00:00:00 2001 From: Defelo Date: Sat, 22 Feb 2025 10:04:52 +0100 Subject: [PATCH 1/2] niri: 25.01 -> 25.02 --- pkgs/by-name/ni/niri/package.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ni/niri/package.nix b/pkgs/by-name/ni/niri/package.nix index 50b239e857a4..4c83a0a3cdaf 100644 --- a/pkgs/by-name/ni/niri/package.nix +++ b/pkgs/by-name/ni/niri/package.nix @@ -24,13 +24,13 @@ rustPlatform.buildRustPackage rec { pname = "niri"; - version = "25.01"; + version = "25.02"; src = fetchFromGitHub { owner = "YaLTeR"; repo = "niri"; tag = "v${version}"; - hash = "sha256-AJ1rlgNOPb3/+DbS5hkhm21t6Oz8IgqLllwmZt0lyzk="; + hash = "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8="; }; postPatch = '' @@ -40,7 +40,7 @@ rustPlatform.buildRustPackage rec { ''; useFetchCargoVendor = true; - cargoHash = "sha256-eGI3i7FnjZGEfcGvEpNLOog8cgExBJuGoXM/oHsui0M="; + cargoHash = "sha256-xUjBQ65INi5qD7s5SpPw9TISgY6I3bjjUBmpubvM43I="; strictDeps = true; @@ -104,8 +104,6 @@ rustPlatform.buildRustPackage rec { preCheck = '' export XDG_RUNTIME_DIR=$(mktemp -d) - # See https://github.com/YaLTeR/niri/issues/953 - export RAYON_NUM_THREADS=1 ''; passthru = { From 92a55af5c56ef5d5ce31ad9c2a75e79fab4a1f88 Mon Sep 17 00:00:00 2001 From: Defelo Date: Sat, 22 Feb 2025 10:14:21 +0100 Subject: [PATCH 2/2] 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; }; -} +})