3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/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 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 {
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";
homepage = "https://www.thanassis.space/rsbep.html";
2021-03-20 20:19:08 +00:00
license = licenses.gpl3Plus;
maintainers = [ maintainers.erikarvstedt ];
2018-03-01 18:41:19 +00:00
};
}