nixpkgs/pkgs/by-name/rs/rsbep/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

47 lines
1.1 KiB
Nix

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