2021-03-23 19:22:30 +00:00
|
|
|
{ lib, stdenv, coreutils, gawk, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "rsbep";
|
2021-03-23 19:22:30 +00:00
|
|
|
version = "0.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ttsiodras";
|
|
|
|
repo = "rsbep-backup";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0is4jgil3wdqbvx9h66xcyzbqy84ndyydnnay2g9k81a4mcz4dns";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2021-03-23 19:22:30 +00:00
|
|
|
path="export PATH=$out/bin:$libexecDir:${lib.makeBinPath [ coreutils gawk ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i "2i$path" freeze.sh
|
|
|
|
sed -i "2i$path" melt.sh
|
|
|
|
|
|
|
|
# Remove unneded binary
|
|
|
|
rm poorZFS.py
|
|
|
|
'';
|
|
|
|
|
2021-03-23 19:22:30 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
cd $TMP
|
|
|
|
echo hello > input
|
|
|
|
$out/bin/freeze.sh input > packed
|
|
|
|
$out/bin/melt.sh packed > output
|
|
|
|
diff -u input output
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Create resilient backups with Reed-Solomon error correction and byte-spreading";
|
|
|
|
homepage = "https://www.thanassis.space/rsbep.html";
|
2021-03-23 19:22:30 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.earvstedt ];
|
|
|
|
};
|
|
|
|
}
|