@@ -0,0 +1,32 @@
1+{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
2+
3+buildGoPackage rec {
4+ name = "restic-${version}";
5+ version = "0.5.0";
6+
7+ goPackagePath = "github.com/restic/restic";
8+
9+ src = fetchFromGitHub {
10+ owner = "restic";
11+ repo = "restic";
12+ rev = "v${version}";
13+ sha256 = "0dj6zg4b00pwgs6nj7w5s0jxm6cfavd9kdcq0z4spypwdf211cgl";
14+ };
15+
16+ buildPhase = ''
17+ cd go/src/${goPackagePath}
18+ go run build.go
19+ '';
20+
21+ installPhase = ''
22+ mkdir -p $bin/bin/
23+ cp restic $bin/bin/
24+ '';
25+
26+ meta = with stdenv.lib; {
27+ homepage = https://restic.github.io;
28+ description = "A backup program that is fast, efficient and secure";
29+ platforms = platforms.linux;
30+ license = licenses.bsd2;
31+ };
32+}