diff options
author | Philip Taron <philip.taron@gmail.com> | 2023-11-30 09:11:31 -0800 |
---|---|---|
committer | Philip Taron <philip.taron@gmail.com> | 2023-11-30 09:11:31 -0800 |
commit | 3da9fa3ad3bdb6b7b3f4917b9bc0d47001de9e12 (patch) | |
tree | a167b2b8ddc720d0fe71ee7ff90f5379ceb0218d | |
parent | 6b20d38e0126b5fbc95fb34b9d7c9006e415cf2d (diff) |
qrtool: add shell completions and man pages
-rw-r--r-- | pkgs/by-name/qr/qrtool/package.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/by-name/qr/qrtool/package.nix b/pkgs/by-name/qr/qrtool/package.nix index 182bd1a4ea57a..31bc57b89ee3c 100644 --- a/pkgs/by-name/qr/qrtool/package.nix +++ b/pkgs/by-name/qr/qrtool/package.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , rustPlatform , asciidoctor +, installShellFiles }: let name = "qrtool"; version = "0.8.5"; @@ -19,7 +20,17 @@ in rustPlatform.buildRustPackage { cargoSha256 = "sha256-JOnvlabCr3fZsIIRc2qTjf50Ga83zL8Aoo2sqzMBs7g="; - nativeBuildInputs = [ asciidoctor ]; + nativeBuildInputs = [ asciidoctor installShellFiles ]; + + postInstall = '' + # Built by ./build.rs using `asciidoctor` + installManPage ./target/*/release/build/${name}*/out/*.? + + installShellCompletion --cmd ${name} \ + --bash <($out/bin/${name} --generate-completion bash) \ + --fish <($out/bin/${name} --generate-completion fish) \ + --zsh <($out/bin/${name} --generate-completion zsh) + ''; meta = with lib; { maintainers = with maintainers; [ philiptaron ]; |