19 stdenv.mkDerivation rec {
24 url = "https://digint.ch/download/btrbk/releases/${pname}-${version}.tar.xz";
25 sha256 = "AuKsZHyRhGMgLL5ge7lVV6T3/SNwaRJDM8VNpbK7t2s=";
28 nativeBuildInputs = [ asciidoctor makeWrapper ];
30 buildInputs = with perlPackages; [ perl DateCalc ];
33 for f in $(find . -name Makefile); do
34 substituteInPlace "$f" \
35 --replace "/usr" "$out" \
36 --replace "/etc" "$out/etc"
39 # Tainted Mode disables PERL5LIB
40 substituteInPlace btrbk \
41 --replace "perl -T" "perl" \
42 --replace "\$0" "\$ENV{'program_name'}"
44 # Fix SSH filter script
45 sed -i '/^export PATH/d' ssh_filter_btrbk.sh
46 substituteInPlace ssh_filter_btrbk.sh --replace logger ${util-linux}/bin/logger
50 wrapProgram $out/bin/btrbk \
51 --set PERL5LIB $PERL5LIB \
52 --run 'export program_name=$0' \
53 --prefix PATH ':' "${lib.makeBinPath [ btrfs-progs bash mbuffer openssh ]}"
57 inherit (nixosTests) btrbk btrbk-no-timer btrbk-section-order btrbk-doas;
60 passthru.updateScript = genericUpdater {
61 versionLister = writeShellScript "btrbk-versionLister" ''
62 ${curl}/bin/curl -s https://digint.ch/download/btrbk/releases/ | ${perl}/bin/perl -lne 'print $1 if /btrbk-([0-9.]*)\.tar/'
67 description = "Backup tool for btrfs subvolumes";
68 homepage = "https://digint.ch/btrbk";
69 license = licenses.gpl3Only;
70 platforms = platforms.unix;
71 maintainers = with maintainers; [ asymmetric ];
72 mainProgram = "btrbk";