nix: add manpages, completion to output

This commit is contained in:
Cole Mickens 2022-03-02 00:15:48 -08:00 committed by Martin von Zweigbergk
parent 8cdfc81cc2
commit 2a6ab8b6fc

View file

@ -31,6 +31,7 @@
, Security , Security
, SystemConfiguration , SystemConfiguration
, libiconv , libiconv
, installShellFiles
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
@ -42,13 +43,27 @@
cargoLock = { cargoLock = {
lockFile = "${self}/Cargo.lock"; lockFile = "${self}/Cargo.lock";
}; };
nativeBuildInputs = [ pkgconfig gzip makeWrapper ]; nativeBuildInputs = [
pkgconfig gzip makeWrapper
installShellFiles
];
buildInputs = [ openssl dbus sqlite ] buildInputs = [ openssl dbus sqlite ]
++ lib.optionals stdenv.isDarwin [ ++ lib.optionals stdenv.isDarwin [
Security Security
SystemConfiguration SystemConfiguration
libiconv libiconv
]; ];
postInstall = ''
$out/bin/jj debug mangen > ./jj.1
installManPage ./jj.1
$out/bin/jj debug completion --bash > ./completions.bash
installShellCompletion --bash --name ${pname}.bash ./completions.bash
$out/bin/jj debug completion --fish > ./completions.fish
installShellCompletion --fish --name ${pname}.fish ./completions.fish
$out/bin/jj debug completion --zsh > ./completions.zsh
installShellCompletion --zsh --name _${pname} ./completions.zsh
'';
} }
) )