koji: install completions, check version
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
openssl,
|
||||
gitMinimal,
|
||||
writableTmpDirAsHomeHook,
|
||||
installShellFiles,
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
@@ -30,6 +32,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
perl
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@@ -46,6 +49,17 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
git config --global user.email 'nix-user@example.com'
|
||||
'';
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd koji \
|
||||
--bash <($out/bin/koji completions bash) \
|
||||
--fish <($out/bin/koji completions fish) \
|
||||
--zsh <($out/bin/koji completions zsh)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
|
||||
|
||||
meta = {
|
||||
description = "Interactive CLI for creating conventional commits";
|
||||
homepage = "https://github.com/its-danny/koji";
|
||||
|
||||
Reference in New Issue
Block a user