summary refs log tree commit diff
path: root/pkgs/tools/backup/restic/rest-server.nix
blob: 699343b8728d24ef2a68c700fa2b8910f9a95908 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "restic-rest-server";
  version = "0.11.0";

  src = fetchFromGitHub {
    owner = "restic";
    repo = "rest-server";
    rev = "v${version}";
    hash = "sha256-ninPODztNzvB2js9cuNAuExQLK/OGOu80ZNW0BPrdds=";
  };

  vendorSha256 = "sha256-8x5qYvIX/C5BaewrTNVbIIadL+7XegbRUZiEDWmJM+c=";

  preCheck = ''
    substituteInPlace cmd/rest-server/main_test.go \
      --replace "/tmp/restic" "/build/restic"
  '';

  meta = with lib; {
    inherit (src.meta) homepage;
    description = "A high performance HTTP server that implements restic's REST backend API";
    platforms = platforms.unix;
    license = licenses.bsd2;
    maintainers = with maintainers; [ dotlambda ];
  };
}