niri: generate completions

Generate bash, zsh and fish completions after compilation and add them
to the derivation.
This commit is contained in:
Rouven Czerwinski 2025-06-09 17:15:55 +02:00
parent 0b35f05269
commit 827020f4fd

View File

@ -3,6 +3,7 @@
dbus,
eudev,
fetchFromGitHub,
installShellFiles,
libdisplay-info,
libglvnd,
libinput,
@ -15,6 +16,7 @@
pkg-config,
rustPlatform,
seatd,
stdenv,
systemd,
wayland,
withDbus ? true,
@ -46,6 +48,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
strictDeps = true;
nativeBuildInputs = [
installShellFiles
pkg-config
rustPlatform.bindgenHook
];
@ -88,6 +91,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
''
+ lib.optionalString withDinit ''
install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd $pname \
--bash <($out/bin/niri completions bash) \
--fish <($out/bin/niri completions fish) \
--zsh <($out/bin/niri completions zsh)
'';
env = {