2020-04-26 01:34:20 -07:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, installShellFiles, nixosTests}:
|
2017-03-15 15:44:09 -07:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "restic";
|
2019-12-17 09:38:08 -08:00
|
|
|
version = "0.9.6";
|
2017-03-15 15:44:09 -07:00
|
|
|
|
|
|
|
goPackagePath = "github.com/restic/restic";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "restic";
|
|
|
|
repo = "restic";
|
|
|
|
rev = "v${version}";
|
2019-12-17 09:38:08 -08:00
|
|
|
sha256 = "0lydll93n1lcn1fl669b9cikmzz9d6vfpc8ky3ng5fi8kj3v1dz7";
|
2017-03-15 15:44:09 -07:00
|
|
|
};
|
|
|
|
|
2020-04-26 01:34:20 -07:00
|
|
|
subPackages = [ "cmd/restic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-02-07 02:39:18 -08:00
|
|
|
passthru.tests.restic = nixosTests.restic;
|
|
|
|
|
2020-04-26 01:34:20 -07:00
|
|
|
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
2020-04-27 18:50:57 -07:00
|
|
|
$out/bin/restic generate \
|
2020-04-26 01:34:20 -07:00
|
|
|
--bash-completion restic.bash \
|
|
|
|
--zsh-completion restic.zsh \
|
|
|
|
--man .
|
|
|
|
installShellCompletion restic.{bash,zsh}
|
|
|
|
installManPage *.1
|
2017-03-15 15:44:09 -07:00
|
|
|
'';
|
|
|
|
|
2018-05-21 13:15:33 -07:00
|
|
|
meta = with lib; {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://restic.net";
|
2017-03-15 15:44:09 -07:00
|
|
|
description = "A backup program that is fast, efficient and secure";
|
2017-08-03 07:37:04 -07:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2017-03-15 15:44:09 -07:00
|
|
|
license = licenses.bsd2;
|
2017-05-29 14:53:49 -07:00
|
|
|
maintainers = [ maintainers.mbrgm ];
|
2017-03-15 15:44:09 -07:00
|
|
|
};
|
|
|
|
}
|