vault-tasks: 0.11.2 -> 0.12.0

Also added shell completions installation
This commit is contained in:
Louis Thevenet
2025-06-11 22:00:45 +02:00
parent 4be599ad29
commit 1852328016
+32 -4
View File
@@ -2,10 +2,13 @@
lib,
fetchFromGitHub,
rustPlatform,
stdenv,
buildPackages,
installShellFiles,
nix-update-script,
}:
let
version = "0.11.2";
version = "0.12.0";
in
rustPlatform.buildRustPackage {
pname = "vault-tasks";
@@ -14,12 +17,37 @@ rustPlatform.buildRustPackage {
owner = "louis-thevenet";
repo = "vault-tasks";
rev = "v${version}";
hash = "sha256-DcnOuQ37fzLVJOteP7ZiA9IxNAd6lH6zelaO5GCvakk=";
hash = "sha256-PMqGqvyxgkGRVahQ+ruDA0vFT0162DrZU92nT4SMTGw=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-/5CpIPdqIvxwiplMqXZ1J04oQoK9rnzDP1N7ffrbJDk=";
cargoHash = "sha256-34c5i2kIoQuTkm1SF7bYX109noVGaGJ47b2FCxQUyB8=";
postInstall = "install -Dm444 desktop/vault-tasks.desktop -t $out/share/applications";
nativeBuildInputs = [
installShellFiles
];
postInstall =
''
install -Dm444 desktop/vault-tasks.desktop -t $out/share/applications
''
+ (
let
vault-tasks =
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
placeholder "out"
else
buildPackages.vault-tasks;
in
''
# vault-tasks tries to load a config file from ~/.config/ before generating completions
export HOME="$(mktemp -d)"
installShellCompletion --cmd vault-tasks \
--bash <(${vault-tasks}/bin/vault-tasks generate-completions bash) \
--fish <(${vault-tasks}/bin/vault-tasks generate-completions fish) \
--zsh <(${vault-tasks}/bin/vault-tasks generate-completions zsh)
''
);
passthru.updateScript = nix-update-script { };