nixpkgs-suyu/pkgs/tools/backup/rsbep/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.1 KiB
Nix
Raw Normal View History

2021-03-20 21:19:08 +01:00
{ lib, stdenv, coreutils, gawk, fetchFromGitHub }:
2018-03-01 19:41:19 +01:00
2021-03-20 21:19:08 +01:00
stdenv.mkDerivation rec {
pname = "rsbep";
2021-03-20 21:19:08 +01:00
version = "0.2.0";
2018-03-01 19:41:19 +01:00
2021-03-20 21:19:08 +01:00
src = fetchFromGitHub {
owner = "ttsiodras";
repo = "rsbep-backup";
rev = "v${version}";
sha256 = "0is4jgil3wdqbvx9h66xcyzbqy84ndyydnnay2g9k81a4mcz4dns";
2018-03-01 19:41:19 +01: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 21:19:08 +01:00
path="export PATH=$out/bin:$libexecDir:${lib.makeBinPath [ coreutils gawk ]}"
2018-03-01 19:41:19 +01:00
sed -i "2i$path" freeze.sh
sed -i "2i$path" melt.sh
# Remove unneded binary
rm poorZFS.py
'';
2021-03-20 21:19:08 +01: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 19:41:19 +01: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-20 21:19:08 +01:00
license = licenses.gpl3Plus;
2018-03-01 19:41:19 +01:00
maintainers = [ maintainers.earvstedt ];
};
}