summary refs log tree commit diff
path: root/pkgs/tools/backup/rsbep/default.nix
blob: 4c13c831ba94caec5e51a1f78ddc38f6837a7473 (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
29
30
31
32
33
34
35
36
37
{ stdenv, lib, coreutils, gnused, gawk, fetchurl }:

stdenv.mkDerivation rec {
  pname = "rsbep";
  version = "0.1.0";

  src = fetchurl {
    url = "https://www.thanassis.space/rsbep-0.1.0-ttsiodras.tar.bz2";
    sha256 = "1zji34kc9srxp0h1s1m7k60mvgsir1wrx1n3wc990jszfplr32zc";
  };

  postFixup = ''
    cd $out/bin

    # Move internal tool 'rsbep_chopper' to libexec
    libexecDir=$out/libexec/rsbep
    mkdir -p $libexecDir
    mv rsbep_chopper $libexecDir

    # Fix store dependencies in scripts
    path="export PATH=$out/bin:$libexecDir:${lib.makeBinPath [ coreutils gnused gawk ]}"
    sed -i "2i$path" freeze.sh
    sed -i "2i$path" melt.sh

    substituteInPlace freeze.sh --replace /bin/ls ls

    # Remove unneded binary
    rm poorZFS.py
  '';

  meta = with lib; {
    description = "Create resilient backups with Reed-Solomon error correction and byte-spreading";
    homepage = https://www.thanassis.space/rsbep.html;
    license = licenses.gpl3;
    maintainers = [ maintainers.earvstedt ];
  };
}