diff --git a/pkgs/applications/version-management/git-cliff/default.nix b/pkgs/applications/version-management/git-cliff/default.nix index 3e5dcec035b3..864e233bac22 100644 --- a/pkgs/applications/version-management/git-cliff/default.nix +++ b/pkgs/applications/version-management/git-cliff/default.nix @@ -4,6 +4,7 @@ , rustPlatform , Security , SystemConfiguration +, installShellFiles }: rustPlatform.buildRustPackage rec { @@ -26,6 +27,23 @@ rustPlatform.buildRustPackage rec { Security SystemConfiguration ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + export OUT_DIR=$(mktemp -d) + + # Generate shell completions + $out/bin/git-cliff-completions + installShellCompletion \ + --bash $OUT_DIR/git-cliff.bash \ + --fish $OUT_DIR/git-cliff.fish \ + --zsh $OUT_DIR/_git-cliff + + # Generate man page + $out/bin/git-cliff-mangen + installManPage $OUT_DIR/git-cliff.1 + ''; + meta = with lib; { description = "Highly customizable Changelog Generator that follows Conventional Commit specifications"; homepage = "https://github.com/orhun/git-cliff";