git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #123089 from Thesola10/dduper

dduper: init at v0.04

commit090f0937fbdd62334471f28445b976438f3a83a3 authorGuillaume Girol <symphorien@users.noreply.github.com> dateWed 19 May 2021, 19:26 (5 years ago) parent5833277ec2c8df
2 files changed+52
pkgs/tools/filesystems/dduper/default.nix+50 pkgs/top-level/all-packages.nix+2
pkgs/tools/filesystems/dduper/default.nixnew file+50
@@ -0,0 +1,50 @@
1+{ lib, stdenv, fetchpatch, fetchFromGitHub, btrfs-progs, python3 }:
2+
3+let
4+ btrfsProgsPatched = btrfs-progs.overrideAttrs (oldAttrs: {
5+ patches = [
6+ (fetchpatch {
7+ name = "0001-Print-csum-for-a-given-file-on-stdout.patch";
8+ url = "https://raw.githubusercontent.com/Lakshmipathi/dduper/8fab08e0f1901bf54411d25f1767b48c978074cb/patch/btrfs-progs-v5.9/0001-Print-csum-for-a-given-file-on-stdout.patch";
9+ sha256 = "1li9lslrap70ibad8sij3bgpxn5lqs0j10l60bmy3c36y866q3g1";
10+ })
11+ ];
12+ });
13+ py3 = python3.withPackages (ps: with ps; [
14+ prettytable
15+ numpy
16+ ]);
17+in
18+stdenv.mkDerivation rec {
19+ pname = "dduper";
20+ version = "0.04";
21+
22+ src = fetchFromGitHub {
23+ owner = "lakshmipathi";
24+ repo = "dduper";
25+ rev = "v${version}";
26+ sha256 = "09ncdawxkffldadqhfblqlkdl05q2qmywxyg6p61fv3dr2f2v5wm";
27+ };
28+
29+ buildInputs = [
30+ btrfsProgsPatched
31+ py3
32+ ];
33+
34+ patchPhase = ''
35+ substituteInPlace ./dduper --replace "/usr/sbin/btrfs.static" "${btrfsProgsPatched}/bin/btrfs"
36+ '';
37+
38+ installPhase = ''
39+ mkdir -p $out/bin
40+ install -m755 ./dduper $out/bin
41+ '';
42+
43+ meta = with lib; {
44+ description = "Fast block-level out-of-band BTRFS deduplication tool.";
45+ homepage = "https://github.com/Lakshmipathi/dduper";
46+ license = licenses.gpl2Plus;
47+ maintainers = with maintainers; [ thesola10 ];
48+ platforms = platforms.linux;
49+ };
50+}
pkgs/top-level/all-packages.nix+2
@@ -2294,6 +2294,8 @@ in
22942294
22952295 ddate = callPackage ../tools/misc/ddate { };
22962296
2297+ dduper = callPackage ../tools/filesystems/dduper { };
2298+
22972299 dedup = callPackage ../tools/backup/dedup { };
22982300
22992301 dehydrated = callPackage ../tools/admin/dehydrated { };