nixpkgs-suyu/pkgs/tools/backup/restic/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{ stdenv, lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper
2020-07-05 22:25:06 +02:00
, nixosTests, rclone }:
2017-03-15 23:44:09 +01:00
buildGoModule rec {
pname = "restic";
version = "0.16.4";
2017-03-15 23:44:09 +01:00
src = fetchFromGitHub {
owner = "restic";
repo = "restic";
rev = "v${version}";
hash = "sha256-TSUhrtSgGIPM/cUzA6WDtCpqCyjtnM5BZDhK6udR0Ek=";
2017-03-15 23:44:09 +01:00
};
2021-02-25 23:00:20 +01:00
patches = [
# The TestRestoreWithPermissionFailure test fails in Nixs build sandbox
./0001-Skip-testing-restore-with-permission-failure.patch
];
vendorHash = "sha256-E+Erf8AdlMBdep1g2SpI8JKIdJuKqmyWEUmh8Rs5R/o=";
subPackages = [ "cmd/restic" ];
2020-07-05 22:25:06 +02:00
nativeBuildInputs = [ installShellFiles makeWrapper ];
2020-02-07 11:39:18 +01:00
passthru.tests.restic = nixosTests.restic;
postPatch = ''
rm cmd/restic/cmd_mount_integration_test.go
'';
2020-07-05 22:25:06 +02:00
postInstall = ''
wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin'
'' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
$out/bin/restic generate \
--bash-completion restic.bash \
2023-07-05 19:50:22 +02:00
--fish-completion restic.fish \
--zsh-completion restic.zsh \
--man .
2023-07-05 19:50:22 +02:00
installShellCompletion restic.{bash,fish,zsh}
installManPage *.1
2017-03-15 23:44:09 +01:00
'';
2018-05-21 22:15:33 +02:00
meta = with lib; {
homepage = "https://restic.net";
changelog = "https://github.com/restic/restic/blob/${src.rev}/CHANGELOG.md";
2017-03-15 23:44:09 +01:00
description = "A backup program that is fast, efficient and secure";
2017-08-03 16:37:04 +02:00
platforms = platforms.linux ++ platforms.darwin;
2017-03-15 23:44:09 +01:00
license = licenses.bsd2;
maintainers = [ maintainers.mbrgm maintainers.dotlambda ];
2023-12-12 21:49:17 +01:00
mainProgram = "restic";
2017-03-15 23:44:09 +01:00
};
}