2024-09-19 14:19:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
stdenv,
|
|
|
|
Security,
|
|
|
|
SystemConfiguration,
|
|
|
|
installShellFiles,
|
|
|
|
nix-update-script,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-09-19 14:19:46 +00:00
|
|
|
pname = "rustic";
|
|
|
|
version = "0.8.1";
|
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-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-SOXuQIdebzMHyO/r+0bvhZvdc09pNPiCXgYfzMoZUZo=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-5tXaq/FPC3T+f1p4RtihQGgwAptcO58mOKQhiOpjacc=";
|
2024-02-07 01:22:34 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
# At the time of writing, upstream defaults to "self-update", "tui", and "webdav".
|
2024-02-07 01:22:34 +00:00
|
|
|
# "self-update" is a self-updater, which we don't want in nixpkgs.
|
2024-09-19 14:19:46 +00:00
|
|
|
# With each update we should therefore ensure that we mimic the default features
|
|
|
|
# as closely as possible.
|
2024-02-07 01:22:34 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = [
|
2024-09-19 14:19:46 +00:00
|
|
|
"tui"
|
2024-02-07 01:22:34 +00:00
|
|
|
"webdav"
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-09-19 14:19:46 +00:00
|
|
|
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;
|
2024-09-19 14:19:46 +00:00
|
|
|
license = [
|
|
|
|
lib.licenses.mit
|
|
|
|
lib.licenses.asl20
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
maintainers = [ lib.maintainers.nobbz ];
|
|
|
|
};
|
|
|
|
}
|