depot/third_party/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

36 lines
1.1 KiB
Nix

{ lib, fetchFromGitHub, rustPlatform, stdenv, darwin, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "rustic-rs";
version = "0.3.2";
src = fetchFromGitHub {
owner = "rustic-rs";
repo = "rustic";
rev = "v${version}";
hash = "sha256-MGFtJUfPK6IH3w8xe/RZaXS+QDIVS3jFSnf4VYiSLM4=";
};
cargoHash = "sha256-siJrqL7HjUQvcyXpUN5rQWNeQNBc+693N1xTSvlOixI=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ darwin.Security ];
postInstall = ''
for shell in {ba,fi,z}sh; do
$out/bin/rustic completions $shell > rustic.$shell
done
installShellCompletion rustic.{ba,fi,z}sh
'';
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";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
license = [ lib.licenses.mit lib.licenses.asl20 ];
maintainers = [ lib.maintainers.nobbz ];
};
}