From cc419ccaefba3540224c84a322449bbefe8b3c01 Mon Sep 17 00:00:00 2001 From: Ilia Date: Sat, 14 Dec 2024 11:18:41 +0300 Subject: [PATCH] eww: generate shell completions --- pkgs/by-name/ew/eww/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/ew/eww/package.nix b/pkgs/by-name/ew/eww/package.nix index 41bf6c7b5500a..f9882eacf2f49 100644 --- a/pkgs/by-name/ew/eww/package.nix +++ b/pkgs/by-name/ew/eww/package.nix @@ -2,6 +2,7 @@ lib, rustPlatform, fetchFromGitHub, + installShellFiles, pkg-config, wrapGAppsHook3, gtk3, @@ -31,6 +32,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-55lmQl5pJwrEj5RlSG8b0PqtZVrASxTmX4Qdk090DZo="; nativeBuildInputs = [ + installShellFiles pkg-config wrapGAppsHook3 ]; @@ -52,6 +54,13 @@ rustPlatform.buildRustPackage rec { # requires unstable rust features RUSTC_BOOTSTRAP = 1; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd eww \ + --bash <($out/bin/eww shell-completions --shell bash) \ + --fish <($out/bin/eww shell-completions --shell fish) \ + --zsh <($out/bin/eww shell-completions --shell zsh) + ''; + passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; meta = {