nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 coreutils,
5 gawk,
6 fetchFromGitHub,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "rsbep";
11 version = "0.2.0";
12
13 src = fetchFromGitHub {
14 owner = "ttsiodras";
15 repo = "rsbep-backup";
16 rev = "v${version}";
17 sha256 = "0is4jgil3wdqbvx9h66xcyzbqy84ndyydnnay2g9k81a4mcz4dns";
18 };
19
20 postFixup = ''
21 cd $out/bin
22
23 # Move internal tool 'rsbep_chopper' to libexec
24 libexecDir=$out/libexec/rsbep
25 mkdir -p $libexecDir
26 mv rsbep_chopper $libexecDir
27
28 # Fix store dependencies in scripts
29 path="export PATH=$out/bin:$libexecDir:${
30 lib.makeBinPath [
31 coreutils
32 gawk
33 ]
34 }"
35 sed -i "2i$path" freeze.sh
36 sed -i "2i$path" melt.sh
37
38 # Remove unneded binary
39 rm poorZFS.py
40 '';
41
42 doInstallCheck = true;
43 installCheckPhase = ''
44 cd $TMP
45 echo hello > input
46 $out/bin/freeze.sh input > packed
47 $out/bin/melt.sh packed > output
48 diff -u input output
49 '';
50
51 meta = with lib; {
52 description = "Create resilient backups with Reed-Solomon error correction and byte-spreading";
53 homepage = "https://www.thanassis.space/rsbep.html";
54 license = licenses.gpl3Plus;
55 maintainers = [ maintainers.erikarvstedt ];
56 };
57}