depot/third_party/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

42 lines
1.3 KiB
Nix

{ lib, fetchFromGitHub, rustPlatform, stdenv, Security, installShellFiles, nix-update-script }:
rustPlatform.buildRustPackage rec {
pname = "rustic-rs";
version = "0.5.0";
src = fetchFromGitHub {
owner = "rustic-rs";
repo = "rustic";
rev = "refs/tags/v${version}";
hash = "sha256-r4hOjX/LKv2wX720FMEztUo9rf2hDBLfcHtENSZNA3U=";
};
cargoHash = "sha256-sNxD8rDkfUw5aVhRYpYftpPMiWhiTYDdShlVZvx2BHk=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
## v0.5.0 panics when trying to generate zsh completions due to a bug.
## See https://github.com/rustic-rs/rustic/issues/533
## and https://github.com/rustic-rs/rustic/pull/536
postInstall = ''
for shell in {ba,fi}sh; do
$out/bin/rustic completions $shell > rustic.$shell
done
installShellCompletion rustic.{ba,fi}sh
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/rustic-rs/rustic";
changelog = "https://github.com/rustic-rs/rustic/blob/${src.rev}/changelog/${version}.txt";
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 ];
};
}