1{ lib
2, buildGoModule
3, fetchFromGitHub
4, makeWrapper
5, openssh
6}:
7buildGoModule rec {
8 pname = "zrepl";
9 version = "0.4.0";
10
11 src = fetchFromGitHub {
12 owner = "zrepl";
13 repo = "zrepl";
14 rev = "v${version}";
15 sha256 = "5Bp8XGCjibDJgeAjW98rcABuddI+CV4Fh3hFJaKKwbo=";
16 };
17
18 vendorSha256 = "MwmYiK2z7ZK5kKBZV7K6kCZRSd7v5Sgjoih1eeOh6go=";
19
20 subPackages = [ "." ];
21
22 nativeBuildInputs = [
23 makeWrapper
24 ];
25
26 postInstall = ''
27 mkdir -p $out/lib/systemd/system
28 substitute dist/systemd/zrepl.service $out/lib/systemd/system/zrepl.service \
29 --replace /usr/local/bin/zrepl $out/bin/zrepl
30
31 wrapProgram $out/bin/zrepl \
32 --prefix PATH : ${lib.makeBinPath [ openssh ]}
33 '';
34
35 meta = with lib; {
36 homepage = "https://zrepl.github.io/";
37 description = "A one-stop, integrated solution for ZFS replication";
38 platforms = platforms.linux;
39 license = licenses.mit;
40 maintainers = with maintainers; [ cole-h danderson ];
41 };
42}