Skip to content

Commit 172cb3e

Browse files
authored
openpgp-card-tools: Add shell completions and man pages (#354287)
2 parents b35c45a + 5db8bf4 commit 172cb3e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkgs/by-name/op/openpgp-card-tools/package.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
, stdenv
33
, rustPlatform
44
, fetchFromGitea
5+
, installShellFiles
56
, pkg-config
67
, pcsclite
78
, dbus
@@ -24,7 +25,7 @@ rustPlatform.buildRustPackage rec {
2425

2526
cargoHash = "sha256-G5+lVK41hbzy/Ltc0EKoUfqF0M1OYu679jyVjYKJmn0=";
2627

27-
nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
28+
nativeBuildInputs = [ installShellFiles pkg-config rustPlatform.bindgenHook ];
2829

2930
buildInputs = [ pcsclite dbus ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
3031
darwin.apple_sdk.frameworks.PCSC
@@ -37,6 +38,13 @@ rustPlatform.buildRustPackage rec {
3738
};
3839
};
3940

41+
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
42+
OCT_COMPLETION_OUTPUT_DIR=$PWD/shell $out/bin/oct
43+
installShellCompletion ./shell/oct.{bash,fish} ./shell/_oct
44+
OCT_MANPAGE_OUTPUT_DIR=$PWD/man $out/bin/oct
45+
installManPage ./man/*.1
46+
'';
47+
4048
meta = with lib; {
4149
description = "Tool for inspecting and configuring OpenPGP cards";
4250
homepage = "https://codeberg.org/openpgp-card/openpgp-card-tools";

0 commit comments

Comments
 (0)