2021-03-20 20:19:08 +00:00
|
|
|
{ lib, stdenv, coreutils, gawk, fetchFromGitHub }:
|
2018-03-01 18:41:19 +00:00
|
|
|
|
2021-03-20 20:19:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "rsbep";
|
2021-03-20 20:19:08 +00:00
|
|
|
version = "0.2.0";
|
2018-03-01 18:41:19 +00:00
|
|
|
|
2021-03-20 20:19:08 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ttsiodras";
|
|
|
|
repo = "rsbep-backup";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0is4jgil3wdqbvx9h66xcyzbqy84ndyydnnay2g9k81a4mcz4dns";
|
2018-03-01 18:41:19 +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-20 20:19:08 +00:00
|
|
|
path="export PATH=$out/bin:$libexecDir:${lib.makeBinPath [ coreutils gawk ]}"
|
2018-03-01 18:41:19 +00:00
|
|
|
sed -i "2i$path" freeze.sh
|
|
|
|
sed -i "2i$path" melt.sh
|
|
|
|
|
|
|
|
# Remove unneded binary
|
|
|
|
rm poorZFS.py
|
|
|
|
'';
|
|
|
|
|
2021-03-20 20:19:08 +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
|
|
|
|
'';
|
|
|
|
|
2018-03-01 18:41:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Create resilient backups with Reed-Solomon error correction and byte-spreading";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.thanassis.space/rsbep.html";
|
2021-03-20 20:19:08 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2022-06-26 17:12:18 +00:00
|
|
|
maintainers = [ maintainers.erikarvstedt ];
|
2018-03-01 18:41:19 +00:00
|
|
|
};
|
|
|
|
}
|