2025-06-06 13:32:55 -07:00

50 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
installShellFiles,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "rustic";
version = "0.9.5";
src = fetchFromGitHub {
owner = "rustic-rs";
repo = "rustic";
tag = "v${version}";
hash = "sha256-HYPzgynCeWDRRNyACHqnzkjn6uZWS0TDHuJE9STJxbQ=";
};
cargoHash = "sha256-+BlLVnvI2qBfwEtyxmZFNhR9MEzs0/a1Ce6ALOKtoPU=";
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd rustic \
--bash <($out/bin/rustic completions bash) \
--fish <($out/bin/rustic completions fish) \
--zsh <($out/bin/rustic completions zsh)
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/rustic-rs/rustic";
changelog = "https://github.com/rustic-rs/rustic/blob/${src.rev}/CHANGELOG.md";
description = "Fast, encrypted, deduplicated backups powered by pure Rust";
mainProgram = "rustic";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
license = [
lib.licenses.mit
lib.licenses.asl20
];
maintainers = [
lib.maintainers.nobbz
lib.maintainers.pmw
];
};
}