depot/third_party/nixpkgs/pkgs/tools/backup/rustic-rs/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

37 lines
1.1 KiB
Nix

{ lib, fetchFromGitHub, rustPlatform, stdenv, Security, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "rustic-rs";
version = "0.4.1";
src = fetchFromGitHub {
owner = "rustic-rs";
repo = "rustic";
rev = "v${version}";
hash = "sha256-/G79BBSXFe/BqgoE76anXY/kWagSVIhEmdfzI+AE1Ok=";
};
cargoHash = "sha256-TQqp+DSJoBvMgysRmmqyYq80dM+9M0mFkAl4bhTZfNk=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ 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";
mainProgram = "rustic";
platforms = lib.platforms.linux ++ lib.platforms.darwin;
license = [ lib.licenses.mit lib.licenses.asl20 ];
maintainers = [ lib.maintainers.nobbz ];
};
}