{ lib, fetchFromGitHub, rustPlatform, stdenv, Security, SystemConfiguration, installShellFiles, nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "rustic"; version = "0.9.4"; src = fetchFromGitHub { owner = "rustic-rs"; repo = "rustic"; rev = "refs/tags/v${version}"; hash = "sha256-DtLyVfABMRhEaelOBKV6tnFYezOOyM8C9T50sPuaHXQ="; }; cargoHash = "sha256-Ha9qW+nCG4dMUEL6CYm/gl2Xrsp5gQ2+xi0Se5dxmyU="; nativeBuildInputs = [ installShellFiles ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Security SystemConfiguration ]; postInstall = '' for shell in {ba,fi,z}sh; do $out/bin/rustic completions $shell > rustic.$shell done installShellCompletion rustic.{ba,fi,z}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.md"; 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 lib.maintainers.pmw ]; }; }