1 { stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
2 , nixosTests, rclone, python3 }:
8 src = fetchFromGitHub {
12 hash = "sha256-PTy/YcojJGrYQhdp98e3rEMqHIWDMR5jiSC6BdzBT/M=";
16 # The TestRestoreWithPermissionFailure test fails in Nix’s build sandbox
17 ./0001-Skip-testing-restore-with-permission-failure.patch
20 vendorHash = "sha256-tU2msDHktlU0SvvxLQCU64p8DpL8B0QiliVCuHlLTHQ=";
22 subPackages = [ "cmd/restic" ];
24 nativeBuildInputs = [ installShellFiles makeWrapper ];
26 nativeCheckInputs = [ python3 ];
28 passthru.tests = lib.optionalAttrs stdenv.isLinux {
29 restic = nixosTests.restic;
33 rm cmd/restic/cmd_mount_integration_test.go
37 wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
38 '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
39 $out/bin/restic generate \
40 --bash-completion restic.bash \
41 --fish-completion restic.fish \
42 --zsh-completion restic.zsh \
44 installShellCompletion restic.{bash,fish,zsh}
49 homepage = "https://restic.net";
50 changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
51 description = "Backup program that is fast, efficient and secure";
52 platforms = platforms.linux ++ platforms.darwin;
53 license = licenses.bsd2;
54 maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
55 mainProgram = "restic";