2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, stdenv
|
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
|
|
|
, installShellFiles
|
|
|
|
, nix-update-script
|
|
|
|
}:
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rustic-rs";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.7.0";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustic-rs";
|
|
|
|
repo = "rustic";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-jUAmboJTzX4oJZy9rFiPRbm94bVpZGa0SaqotoCU/Ss=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
cargoHash = "sha256-iZuWlYDGGziwb49BfKdt9Ahs6oQ0Ij2iiT0tvL7ZIVk=";
|
|
|
|
|
|
|
|
# At the time of writing, upstream defaults to "self-update" and "webdav".
|
|
|
|
# "self-update" is a self-updater, which we don't want in nixpkgs.
|
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = [
|
|
|
|
"webdav"
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
for shell in {ba,fi,z}sh; do
|
2022-11-21 17:40:18 +00:00
|
|
|
$out/bin/rustic completions $shell > rustic.$shell
|
|
|
|
done
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
installShellCompletion rustic.{ba,fi,z}sh
|
2022-11-21 17:40:18 +00:00
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/rustic-rs/rustic";
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/rustic-rs/rustic/blob/${src.rev}/CHANGELOG.md";
|
2022-11-21 17:40:18 +00:00
|
|
|
description = "fast, encrypted, deduplicated backups powered by pure Rust";
|
2022-11-27 09:42:12 +00:00
|
|
|
mainProgram = "rustic";
|
2022-11-21 17:40:18 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
|
|
license = [ lib.licenses.mit lib.licenses.asl20 ];
|
|
|
|
maintainers = [ lib.maintainers.nobbz ];
|
|
|
|
};
|
|
|
|
}
|