niri: generate completions
Generate bash, zsh and fish completions after compilation and add them to the derivation.
This commit is contained in:
parent
0b35f05269
commit
827020f4fd
@ -3,6 +3,7 @@
|
|||||||
dbus,
|
dbus,
|
||||||
eudev,
|
eudev,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
|
installShellFiles,
|
||||||
libdisplay-info,
|
libdisplay-info,
|
||||||
libglvnd,
|
libglvnd,
|
||||||
libinput,
|
libinput,
|
||||||
@ -15,6 +16,7 @@
|
|||||||
pkg-config,
|
pkg-config,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
seatd,
|
seatd,
|
||||||
|
stdenv,
|
||||||
systemd,
|
systemd,
|
||||||
wayland,
|
wayland,
|
||||||
withDbus ? true,
|
withDbus ? true,
|
||||||
@ -46,6 +48,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
installShellFiles
|
||||||
pkg-config
|
pkg-config
|
||||||
rustPlatform.bindgenHook
|
rustPlatform.bindgenHook
|
||||||
];
|
];
|
||||||
@ -88,6 +91,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
''
|
''
|
||||||
+ lib.optionalString withDinit ''
|
+ lib.optionalString withDinit ''
|
||||||
install -Dm0644 resources/dinit/niri{-shutdown,} -t $out/lib/dinit.d/user
|
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 = {
|
env = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user