From b6fdaa940fa4c53fec8bbe56e2e73541b79b2237 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 31 Jul 2024 16:20:12 -0400 Subject: [PATCH] phraze: install man page and shell completions --- pkgs/by-name/ph/phraze/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/ph/phraze/package.nix b/pkgs/by-name/ph/phraze/package.nix index f227669535c8..0159f2e5ec58 100644 --- a/pkgs/by-name/ph/phraze/package.nix +++ b/pkgs/by-name/ph/phraze/package.nix @@ -5,6 +5,7 @@ nix-update-script, phraze, rustPlatform, + installShellFiles, }: rustPlatform.buildRustPackage rec { @@ -22,6 +23,8 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-jsQlcGRZqa4HHUS3Xc9OZUbI6pHalt9A3fVaz+Th1l0="; + nativeBuildInputs = [ installShellFiles ]; + passthru = { updateScript = nix-update-script { }; tests = { @@ -29,6 +32,15 @@ rustPlatform.buildRustPackage rec { }; }; + postInstall = '' + installManPage target/man/phraze.1 + + installShellCompletion --cmd phraze \ + --bash target/completions/phraze.bash \ + --fish target/completions/phraze.fish \ + --zsh target/completions/_phraze + ''; + meta = { description = "Generate random passphrases"; homepage = "https://github.com/sts10/phraze";