biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / filesystems / dduper / default.nix
blobc63846e2c46a2068272a17b4287283b64bb3ceea
1 { lib, stdenv, fetchpatch, fetchFromGitHub, btrfs-progs, python3 }:
3 let
4   btrfsProgsPatched = btrfs-progs.overrideAttrs {
5     patches = [
6       (fetchpatch {
7         url = "https://raw.githubusercontent.com/Lakshmipathi/dduper/1f1d29eff61430e118f88239545a29f0bcf3e15d/patch/btrfs-progs-v6.3.3/0001-Print-csum-for-a-given-file-on-stdout.patch";
8         hash = "sha256-bO0t8QePnUbMkQQPesZlBF/khD/H8AaWHr2GkOnT6x8=";
9       })
10     ];
11   };
12   py3 = python3.withPackages (ps: with ps; [
13     prettytable
14     numpy
15   ]);
17 stdenv.mkDerivation rec {
18   pname = "dduper";
19   version = "0.04";
21   src = fetchFromGitHub {
22     owner = "lakshmipathi";
23     repo = "dduper";
24     rev = "v${version}";
25     sha256 = "09ncdawxkffldadqhfblqlkdl05q2qmywxyg6p61fv3dr2f2v5wm";
26   };
28   buildInputs = [
29     btrfsProgsPatched
30     py3
31   ];
33   patchPhase = ''
34     substituteInPlace ./dduper --replace "/usr/sbin/btrfs.static" "${btrfsProgsPatched}/bin/btrfs"
35   '';
37   installPhase = ''
38     mkdir -p $out/bin
39     install -m755 ./dduper $out/bin
40   '';
42   meta = with lib; {
43     description = "Fast block-level out-of-band BTRFS deduplication tool";
44     mainProgram = "dduper";
45     homepage = "https://github.com/Lakshmipathi/dduper";
46     license = licenses.gpl2Plus;
47     maintainers = with maintainers; [ thesola10 ];
48     platforms = platforms.linux;
49   };