dotfiles/nix/niri-window-buttons.nix
2026-07-20 21:12:40 -04:00

54 lines
1.7 KiB
Nix

{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, pulseaudio, libpulseaudio
, waybar, gtk3, gdk-pixbuf, glib, cairo, pango, atk, gtk-layer-shell }:
rustPlatform.buildRustPackage {
pname = "niri_window_buttons";
version = "0.4.3";
src = fetchFromGitHub {
owner = "adelmonte";
repo = "niri_window_buttons";
rev = "v0.4.3";
hash = "sha256-CUeeDe5DY7IRf6pCl9g7q5rHNs4ca4mAg0eKgZ0ErlY=";
};
cargoHash = "sha256-STrFRNLgytpLilx0o/StCAnaO1dyWDUQDoTzb7PA2hc=";#lib.fakeHash; # replace after first build
patches = [
# On my system, I guess I have a lot of keyboard inputs, so there's a really annoying
# slow path in niri_window_buttons on the normal left_click_unfocused and left_click_focused
# handler. This disables multi-selection but doesn't query all the input devices
# There's apparently a better way to do this (using GTKs passed modified flags instead so
# there's no evdev polling of input devices) but I'm lazy and dont know rust... so this suffices
# for now
./niri-window-buttons-left-click-no-double-click-delay-when-none-widget.patch
];
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
buildInputs = [
pulseaudio
libpulseaudio
waybar
gtk3
gdk-pixbuf
glib
cairo
pango
atk
gtk-layer-shell
];
installPhase = ''
runHook preInstall
install -Dm755 target/${stdenv.hostPlatform.rust.rustcTarget}/release/libniri_window_buttons.so \
$out/lib/libniri_window_buttons.so
runHook postInstall
'';
RUSTFLAGS = "--cfg waybar_cffi";
meta = with lib; {
description = "Waybar CFFI module for niri window buttons";
license = licenses.gpl3Plus;
};
}