From 6f31ad4851163dde1d288a08ab560dd0d6e6022f Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 7 Nov 2024 19:10:09 +0100 Subject: [PATCH] openpgp-card-tools: Add shell completions and man pages This patch adds a postInstall step to generate and install shell completions and man pages as described in the project readme: https://codeberg.org/openpgp-card/openpgp-card-tools/src/tag/v0.11.7#system-integration --- pkgs/by-name/op/openpgp-card-tools/package.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/op/openpgp-card-tools/package.nix b/pkgs/by-name/op/openpgp-card-tools/package.nix index 8bd0e1fb5cb93..4d288814f446d 100644 --- a/pkgs/by-name/op/openpgp-card-tools/package.nix +++ b/pkgs/by-name/op/openpgp-card-tools/package.nix @@ -2,6 +2,7 @@ , stdenv , rustPlatform , fetchFromGitea +, installShellFiles , pkg-config , pcsclite , dbus @@ -24,7 +25,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-G5+lVK41hbzy/Ltc0EKoUfqF0M1OYu679jyVjYKJmn0="; - nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ]; + nativeBuildInputs = [ installShellFiles pkg-config rustPlatform.bindgenHook ]; buildInputs = [ pcsclite dbus ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.PCSC @@ -37,6 +38,13 @@ rustPlatform.buildRustPackage rec { }; }; + postInstall = '' + OCT_COMPLETION_OUTPUT_DIR=$PWD/shell $out/bin/oct + installShellCompletion ./shell/oct.{bash,fish} ./shell/_oct + OCT_MANPAGE_OUTPUT_DIR=$PWD/man $out/bin/oct + installManPage ./man/*.1 + ''; + meta = with lib; { description = "Tool for inspecting and configuring OpenPGP cards"; homepage = "https://codeberg.org/openpgp-card/openpgp-card-tools";