1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 21:50:55 +00:00
nixpkgs/pkgs/tools/backup/restic/default.nix
Urban Skudnik e9fe3a334b
restic: Fix autocomplete for zsh
zsh requires for files to be prepended with underscore to be
recognized as widgets, see [1] for more details.

[1] https://github.com/NixOS/nixpkgs/pull/46001#issuecomment-418567160
2018-09-05 03:36:56 +02:00

42 lines
1 KiB
Nix

{ lib, buildGoPackage, fetchFromGitHub }:
buildGoPackage rec {
name = "restic-${version}";
version = "0.9.2";
goPackagePath = "github.com/restic/restic";
src = fetchFromGitHub {
owner = "restic";
repo = "restic";
rev = "v${version}";
sha256 = "0kl8yk636i3y7f2kd43pydjh4pv7hhq09p5k54jlysnrbf2kjb4h";
};
buildPhase = ''
cd go/src/${goPackagePath}
go run build.go
'';
installPhase = ''
mkdir -p \
$bin/bin \
$bin/etc/bash_completion.d \
$bin/share/zsh/vendor-completions \
$bin/share/man/man1
cp restic $bin/bin/
$bin/bin/restic generate \
--bash-completion $bin/etc/bash_completion.d/restic.sh \
--zsh-completion $bin/share/zsh/vendor-completions/_restic \
--man $bin/share/man/man1
'';
meta = with lib; {
homepage = https://restic.net;
description = "A backup program that is fast, efficient and secure";
platforms = platforms.linux ++ platforms.darwin;
license = licenses.bsd2;
maintainers = [ maintainers.mbrgm ];
};
}