about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/filesystems
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/filesystems')
-rw-r--r--nixpkgs/pkgs/tools/filesystems/9pfs/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch47
-rw-r--r--nixpkgs/pkgs/tools/filesystems/aefs/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/android-file-transfer/darwin-dont-vendor-dependencies.patch21
-rw-r--r--nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix44
-rw-r--r--nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/archivemount/default.nix22
-rw-r--r--nixpkgs/pkgs/tools/filesystems/avfs/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bashmount/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch52
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix62
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch22
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix53
-rwxr-xr-xnixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper227
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bees/default.nix82
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bindfs/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix38
-rw-r--r--nixpkgs/pkgs/tools/filesystems/blobfuse/install-adls.patch14
-rw-r--r--nixpkgs/pkgs/tools/filesystems/bonnie/default.nix20
-rw-r--r--nixpkgs/pkgs/tools/filesystems/boxfs/default.nix63
-rw-r--r--nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch15
-rw-r--r--nixpkgs/pkgs/tools/filesystems/btrfs-heatmap/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/filesystems/buttersink/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/catcli/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch11
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ceph/default.nix238
-rw-r--r--nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix22
-rw-r--r--nixpkgs/pkgs/tools/filesystems/convoy/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/filesystems/cryfs/default.nix84
-rw-r--r--nixpkgs/pkgs/tools/filesystems/cryfs/use-macfuse.patch207
-rw-r--r--nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch13
-rw-r--r--nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/davfs2/0001-umount_davfs-substitute-ps-command.patch25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/davfs2/0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/davfs2/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch60
-rw-r--r--nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/dduper/default.nix50
-rw-r--r--nixpkgs/pkgs/tools/filesystems/dislocker/default.nix45
-rw-r--r--nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/djmount/default.nix21
-rw-r--r--nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/duff/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/duperemove/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix80
-rw-r--r--nixpkgs/pkgs/tools/filesystems/e2tools/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/encfs/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/exfat/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ext4magic/glibc-fix.patch12
-rw-r--r--nixpkgs/pkgs/tools/filesystems/extundelete/default.nix29
-rw-r--r--nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch29
-rw-r--r--nixpkgs/pkgs/tools/filesystems/f3/default.nix57
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fatresize/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fatsort/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch34
-rw-r--r--nixpkgs/pkgs/tools/filesystems/file-rename/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fsfs/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/filesystems/fwanalyzer/default.nix39
-rw-r--r--nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/genimage/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/genromfs/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/gitfs/default.nix43
-rw-r--r--nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix191
-rw-r--r--nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix20
-rw-r--r--nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix66
-rw-r--r--nixpkgs/pkgs/tools/filesystems/gpart/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/filesystems/grive2/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix49
-rw-r--r--nixpkgs/pkgs/tools/filesystems/httpfs/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix38
-rw-r--r--nixpkgs/pkgs/tools/filesystems/idsk/default.nix29
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ifuse/default.nix29
-rw-r--r--nixpkgs/pkgs/tools/filesystems/irods/common.nix53
-rw-r--r--nixpkgs/pkgs/tools/filesystems/irods/default.nix97
-rw-r--r--nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch71
-rw-r--r--nixpkgs/pkgs/tools/filesystems/irods/zmqcpp-deprecated-send_recv.patch21
-rw-r--r--nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch10
-rw-r--r--nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch12
-rw-r--r--nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix52
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix36
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix35
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch12
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix20
-rw-r--r--nixpkgs/pkgs/tools/filesystems/moosefs/default.nix54
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch39
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix29
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch11
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mtools/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/filesystems/netatalk/default.nix61
-rw-r--r--nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch11
-rw-r--r--nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch19
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix63
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix50
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch51
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix38
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix77
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix76
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix53
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix61
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch12
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix36
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/nixpart/default.nix20
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/filesystems/orangefs/default.nix61
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rar2fs/default.nix39
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rdfind/default.nix21
-rw-r--r--nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch10
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rmfuse/default.nix26
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rmfuse/poetry-git-overlay.nix14
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rmfuse/poetry.lock548
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rmfuse/pyproject.toml15
-rwxr-xr-xnixpkgs/pkgs/tools/filesystems/rmfuse/update5
-rw-r--r--nixpkgs/pkgs/tools/filesystems/rmount/default.nix32
-rw-r--r--nixpkgs/pkgs/tools/filesystems/romdirfs/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/s3backer/default.nix36
-rw-r--r--nixpkgs/pkgs/tools/filesystems/s3fs/default.nix30
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sandboxfs/Cargo.lock.patch640
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sandboxfs/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix61
-rw-r--r--nixpkgs/pkgs/tools/filesystems/securefs/add-macfuse-support.patch188
-rw-r--r--nixpkgs/pkgs/tools/filesystems/securefs/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sftpman/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/simg2img/default.nix25
-rw-r--r--nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix24
-rw-r--r--nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream6
-rw-r--r--nixpkgs/pkgs/tools/filesystems/snapraid/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfs/0001-Mksquashfs-add-no-hardlinks-option.patch76
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch98
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch357
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfs/default.nix54
-rw-r--r--nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sshfs-fuse/common.nix61
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix28
-rw-r--r--nixpkgs/pkgs/tools/filesystems/sshfs-fuse/fix-fuse-darwin-h.patch14
-rw-r--r--nixpkgs/pkgs/tools/filesystems/supertag/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/filesystems/svnfs/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/tmsu/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/tmsu/deps.nix39
-rw-r--r--nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix21
-rw-r--r--nixpkgs/pkgs/tools/filesystems/ubidump/default.nix40
-rw-r--r--nixpkgs/pkgs/tools/filesystems/udftools/default.nix42
-rw-r--r--nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix50
-rw-r--r--nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch14
-rw-r--r--nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix39
-rw-r--r--nixpkgs/pkgs/tools/filesystems/wdfs/default.nix27
-rw-r--r--nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/default.nix37
-rw-r--r--nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/fix-paths.diff12
-rw-r--r--nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix55
-rw-r--r--nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix79
-rw-r--r--nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix65
-rw-r--r--nixpkgs/pkgs/tools/filesystems/zerofree/default.nix33
-rw-r--r--nixpkgs/pkgs/tools/filesystems/zfstools/default.nix41
-rw-r--r--nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix38
178 files changed, 8783 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix b/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix
new file mode 100644
index 000000000000..bf817a508731
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, fuse }:
+
+stdenv.mkDerivation {
+  name = "9pfs-20150918";
+
+  src = fetchFromGitHub {
+    owner = "mischief";
+    repo = "9pfs";
+    rev = "7f4ca4cd750d650c1215b92ac3cc2a28041960e4";
+    sha256 = "007s2idsn6bspmfxv1qabj39ggkgvn6gwdbhczwn04lb4c6gh3xc";
+  };
+
+  # Upstream development has stopped and is no longer accepting patches
+  # https://github.com/mischief/9pfs/pull/3
+  patches = [ ./fix-darwin-build.patch ];
+
+  preConfigure =
+    ''
+      substituteInPlace Makefile --replace '-g bin' ""
+      installFlagsArray+=(BIN=$out/bin MAN=$out/share/man/man1)
+      mkdir -p $out/bin $out/share/man/man1
+    '';
+
+  buildInputs = [ fuse ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://github.com/mischief/9pfs";
+    description = "FUSE-based client of the 9P network filesystem protocol";
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
+    license = with lib.licenses; [ lpl-102 bsd2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch b/nixpkgs/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch
new file mode 100644
index 000000000000..a565248f19d5
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/9pfs/fix-darwin-build.patch
@@ -0,0 +1,47 @@
+From 6b7863b51c97f8ecd9a93fc4347f8938f9b5c05f Mon Sep 17 00:00:00 2001
+From: midchildan <git@midchildan.org>
+Date: Tue, 30 Mar 2021 22:21:51 +0900
+Subject: [PATCH] build: fix build for macOS
+
+---
+ 9pfs.c | 4 ++--
+ libc.h | 4 ++++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/9pfs.c b/9pfs.c
+index 2c481bd..f5c487c 100644
+--- a/9pfs.c
++++ b/9pfs.c
+@@ -30,7 +30,7 @@
+ enum
+ {
+ 	CACHECTLSIZE = 8, /* sizeof("cleared\n") - 1 */
+-	MSIZE = 8192
++	MSIZE_9P = 8192
+ };
+ 
+ void	dir2stat(struct stat*, Dir*);
+@@ -505,7 +505,7 @@ main(int argc, char *argv[])
+ 		freeaddrinfo(ainfo);
+ 
+ 	init9p();
+-	msize = _9pversion(MSIZE);
++	msize = _9pversion(MSIZE_9P);
+ 	if(doauth){
+ 		authfid = _9pauth(AUTHFID, user, NULL);
+ 		ai = auth_proxy(authfid, auth_getkey, "proto=p9any role=client");
+diff --git a/libc.h b/libc.h
+index 099adba..aac03c5 100644
+--- a/libc.h
++++ b/libc.h
+@@ -61,6 +61,10 @@ typedef unsigned char uchar;
+ typedef unsigned long long uvlong;
+ typedef long long vlong;
+ 
++#ifndef __GLIBC__
++typedef unsigned long ulong;
++#endif
++
+ typedef
+ struct Qid
+ {
diff --git a/nixpkgs/pkgs/tools/filesystems/aefs/default.nix b/nixpkgs/pkgs/tools/filesystems/aefs/default.nix
new file mode 100644
index 000000000000..fb6fa01894e4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/aefs/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, fetchpatch, fuse }:
+
+stdenv.mkDerivation rec {
+  name = "aefs-0.4pre259-8843b7c";
+
+  src = fetchurl {
+    url = "http://tarballs.nixos.org/${name}.tar.bz2";
+    sha256 = "167hp58hmgdavg2mqn5dx1xgq24v08n8d6psf33jhbdabzx6a6zq";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/edolstra/aefs/commit/15d8df8b8d5dc1ee20d27a86c4d23163a67f3123.patch";
+      sha256 = "0k36hsyvf8a0ji2hpghgqff2fncj0pllxn8p0rs0aj4h7j2vp4iv";
+    })
+  ];
+
+  # autoconf's AC_CHECK_HEADERS and AC_CHECK_LIBS fail to detect libfuse on
+  # Darwin if FUSE_USE_VERSION isn't set at configure time.
+  #
+  # NOTE: Make sure the value of FUSE_USE_VERSION specified here matches the
+  # actual version used in the source code:
+  #
+  #     $ tar xf "$(nix-build -A aefs.src)"
+  #     $ grep -R FUSE_USE_VERSION
+  configureFlags = lib.optional stdenv.isDarwin "CPPFLAGS=-DFUSE_USE_VERSION=26";
+
+  buildInputs = [ fuse ];
+
+  meta = with lib; {
+    homepage = "https://github.com/edolstra/aefs";
+    description = "A cryptographic filesystem implemented in userspace using FUSE";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.eelco ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix
new file mode 100644
index 000000000000..9c4268e402da
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, fuse, readline, libgcrypt, gmp }:
+
+stdenv.mkDerivation {
+  pname = "afpfs-ng";
+  version = "0.8.2";
+
+  src = fetchFromGitHub {
+    owner  = "simonvetter";
+    repo   = "afpfs-ng";
+    rev    = "f6e24eb73c9283732c3b5d9cb101a1e2e4fade3e";
+    sha256 = "125jx1rsqkiifcffyjb05b2s36rllckdgjaf1bay15k9gzhwwldz";
+  };
+
+  buildInputs = [ fuse readline libgcrypt gmp ];
+
+  meta = with lib; {
+    homepage    = "https://github.com/simonvetter/afpfs-ng";
+    description = "A client implementation of the Apple Filing Protocol";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ rnhmjoj ];
+    platforms   = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/android-file-transfer/darwin-dont-vendor-dependencies.patch b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/darwin-dont-vendor-dependencies.patch
new file mode 100644
index 000000000000..6e0f38582cc7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/darwin-dont-vendor-dependencies.patch
@@ -0,0 +1,21 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8b05ab0..81e31f5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -236,16 +236,6 @@ endif()
+
+ if (''${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ 	set(MACOSX_BUNDLE_LIBS)
+-	if (OPENSSL_FOUND)
+-		list(APPEND MACOSX_BUNDLE_LIBS /usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib)
+-	endif()
+-	if (TAGLIB_FOUND)
+-		list(APPEND MACOSX_BUNDLE_LIBS /usr/local/opt/taglib/lib/libtag.1.dylib)
+-	endif()
+-	if (FUSE_FOUND)
+-		list(APPEND MACOSX_BUNDLE_LIBS /usr/local/lib/libosxfuse.2.dylib)
+-	endif()
+-
+ 	set(MACOSX_BUNDLE_LIBS_INSTALL)
+ 	set(MACOSX_BUNDLE_ROOT_DIR "''${CMAKE_INSTALL_PREFIX}/''${CMAKE_PROJECT_NAME}.app")
+ 	message(STATUS "bundle root dir: ''${MACOSX_BUNDLE_ROOT_DIR}")
diff --git a/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix
new file mode 100644
index 000000000000..a8511f8b99ae
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, fuse
+, readline
+, pkg-config
+, qtbase
+, qttools
+, wrapQtAppsHook }:
+
+mkDerivation rec {
+  pname = "android-file-transfer";
+  version = "4.2";
+
+  src = fetchFromGitHub {
+    owner = "whoozle";
+    repo = "android-file-transfer-linux";
+    rev = "v${version}";
+    sha256 = "125rq8ji83nw6chfw43i0h9c38hjqh1qjibb0gnf9wrigar9zc8b";
+  };
+
+  patches = [ ./darwin-dont-vendor-dependencies.patch ];
+
+  nativeBuildInputs = [ cmake readline pkg-config wrapQtAppsHook ];
+  buildInputs = [ fuse qtbase qttools ];
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir $out/Applications
+    mv $out/*.app $out/Applications
+    for f in $out/Applications/android-file-transfer.app/Contents/MacOS/*; do
+      wrapQtApp "$f"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Reliable MTP client with minimalistic UI";
+    homepage = "https://whoozle.github.io/android-file-transfer-linux/";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.xaverdh ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix
new file mode 100644
index 000000000000..b5d08770ed78
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, fuse3, bzip2, zlib, attr, cmake }:
+
+stdenv.mkDerivation {
+  pname = "apfs-fuse-unstable";
+  version = "2020-09-28";
+
+  src = fetchFromGitHub {
+    owner  = "sgan81";
+    repo   = "apfs-fuse";
+    rev    = "ee71aa5c87c0831c1ae17048951fe9cd7579c3db";
+    sha256 = "0wvsx708km1lnhghny5y69k694x0zy8vlbndswkb7sq81j1r6kwx";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ fuse3 bzip2 zlib attr ];
+  nativeBuildInputs = [ cmake ];
+
+  postFixup = ''
+    ln -s $out/bin/apfs-fuse $out/bin/mount.fuse.apfs-fuse
+  '';
+
+  meta = with lib; {
+    homepage    = "https://github.com/sgan81/apfs-fuse";
+    description = "FUSE driver for APFS (Apple File System)";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ealasu ];
+    platforms   = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix b/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix
new file mode 100644
index 000000000000..32c942aea5b1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse, libarchive }:
+
+let
+  name = "archivemount-0.9.1";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "https://www.cybernoia.de/software/archivemount/${name}.tar.gz";
+    sha256 = "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse libarchive ];
+
+  meta = {
+    description = "Gateway between FUSE and libarchive: allows mounting of cpio, .tar.gz, .tar.bz2 archives";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/avfs/default.nix b/nixpkgs/pkgs/tools/filesystems/avfs/default.nix
new file mode 100644
index 000000000000..b4fc7f1e4f6e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/avfs/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse, xz }:
+
+stdenv.mkDerivation rec {
+  pname = "avfs";
+  version = "1.1.4";
+  src = fetchurl {
+    url = "mirror://sourceforge/avf/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "0ax1zbw4pmggx1b784bfabdqyn39k7109cnl22p69y2phnpq2y9s";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ fuse xz ];
+
+  configureFlags = [
+    "--enable-library"
+    "--enable-fuse"
+  ];
+
+  meta = {
+    homepage = "http://avf.sourceforge.net/";
+    description = "Virtual filesystem that allows browsing of compressed files";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.gpl2Only;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix b/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix
new file mode 100644
index 000000000000..ef7bfd492e37
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix
@@ -0,0 +1,37 @@
+{lib, stdenv, fetchFromGitHub}:
+
+stdenv.mkDerivation rec {
+  pname = "bashmount";
+  version = "4.3.2";
+
+  src = fetchFromGitHub {
+    owner = "jamielinux";
+    repo = "bashmount";
+    rev = version;
+    sha256 = "1irw47s6i1qwxd20cymzlfw5sv579cw877l27j3p66qfhgadwxrl";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bashmount $out/bin
+
+    mkdir -p $out/etc
+    cp bashmount.conf $out/etc
+
+    mkdir -p $out/share/man/man1
+    gzip -c -9 bashmount.1 > bashmount.1.gz
+    cp bashmount.1.gz $out/share/man/man1
+
+    mkdir -p $out/share/doc/bashmount
+    cp COPYING $out/share/doc/bashmount
+    cp NEWS    $out/share/doc/bashmount
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/jamielinux/bashmount";
+    description = "A menu-driven bash script for the management of removable media with udisks";
+    maintainers = [ maintainers.koral ];
+    license = licenses.gpl2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch b/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch
new file mode 100644
index 000000000000..c6cf79785b73
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch
@@ -0,0 +1,52 @@
+This patch does two things:
+1) Drops probe-bcache, so now new util-linux detecting functionality is used.
+2) Drops bcache-register, using kmod (built in udev) and moving registering device
+   into rule using 'sh'.
+This reduces things that need to be present in initrd, replacing them with already
+existing functionality and reducing overall initrd size.
+
+diff --git a/69-bcache.rules b/69-bcache.rules
+index 5d28e70..6a52893 100644
+--- a/69-bcache.rules
++++ b/69-bcache.rules
+@@ -10,15 +10,11 @@ KERNEL=="fd*|sr*", GOTO="bcache_end"
+ # It recognised bcache (util-linux 2.24+)
+ ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found"
+ # It recognised something else; bail
+-ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end"
+-
+-# Backing devices: scan, symlink, register
+-IMPORT{program}="probe-bcache -o udev $tempnode"
+-ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end"
+-ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
++GOTO="bcache_backing_end"
+ 
+ LABEL="bcache_backing_found"
+-RUN+="bcache-register $tempnode"
++RUN{builtin}+="kmod load bcache"
++RUN+="/bin/sh -c 'echo $tempnode > /sys/fs/bcache/register_quiet'"
+ LABEL="bcache_backing_end"
+ 
+ # Cached devices: symlink
+diff --git a/Makefile b/Makefile
+index 3f8d87b..15638a7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,7 +9,7 @@ all: make-bcache probe-bcache bcache-super-show
+ 
+ install: make-bcache probe-bcache bcache-super-show
+ 	$(INSTALL) -m0755 make-bcache bcache-super-show	$(DESTDIR)${PREFIX}/sbin/
+-	$(INSTALL) -m0755 probe-bcache bcache-register		$(DESTDIR)$(UDEVLIBDIR)/
++#	$(INSTALL) -m0755 probe-bcache bcache-register		$(DESTDIR)$(UDEVLIBDIR)/
+ 	$(INSTALL) -m0644 69-bcache.rules	$(DESTDIR)$(UDEVLIBDIR)/rules.d/
+ 	$(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/
+ 	$(INSTALL) -D -m0755 initramfs/hook	$(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
+diff --git a/bcache-register b/bcache-register
+index 9b592bc..75b4faf 100755
+--- a/bcache-register
++++ b/bcache-register
+@@ -1,4 +1,3 @@
+ #!/bin/sh
+-/sbin/modprobe -qba bcache
+ test -f /sys/fs/bcache/register_quiet && echo "$1" > /sys/fs/bcache/register_quiet
+ 
diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix
new file mode 100644
index 000000000000..ba6cb79fbd57
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl, pkg-config, util-linux, bash }:
+
+stdenv.mkDerivation rec {
+  pname = "bcache-tools";
+  version = "1.0.7";
+
+  src = fetchurl {
+    name = "${pname}-${version}.tar.gz";
+    url = "https://github.com/g2p/bcache-tools/archive/v${version}.tar.gz";
+    sha256 = "1gbsh2qw0a7kgck6w0apydiy37nnz5xvdgipa0yqrfmghl86vmv4";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ util-linux ];
+
+  # * Remove broken install rules (they ignore $PREFIX) for stuff we don't need
+  #   anyway (it's distro specific stuff).
+  # * Fixup absolute path to modprobe.
+  prePatch = ''
+    sed -e "/INSTALL.*initramfs\/hook/d" \
+        -e "/INSTALL.*initcpio\/install/d" \
+        -e "/INSTALL.*dracut\/module-setup.sh/d" \
+        -e "s/pkg-config/$PKG_CONFIG/" \
+        -i Makefile
+  '';
+
+  patches = [
+    ./bcache-udev-modern.patch
+    ./fix-static.patch
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "UDEVLIBDIR=${placeholder "out"}/lib/udev/"
+  ];
+
+  preBuild = ''
+    sed -e "s|/bin/sh|${bash}/bin/sh|" -i *.rules
+  '';
+
+  preInstall = ''
+    mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8"
+  '';
+
+  meta = with lib; {
+    description = "User-space tools required for bcache (Linux block layer cache)";
+    longDescription = ''
+      Bcache is a Linux kernel block layer cache. It allows one or more fast
+      disk drives such as flash-based solid state drives (SSDs) to act as a
+      cache for one or more slower hard disk drives.
+
+      This package contains the required user-space tools.
+
+      User documentation is in Documentation/bcache.txt in the Linux kernel
+      tree.
+    '';
+    homepage = "https://bcache.evilpiepirate.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch b/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch
new file mode 100644
index 000000000000..e5dd2df5299d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch
@@ -0,0 +1,22 @@
+diff --git a/bcache.c b/bcache.c
+index 8f37445..79806d8 100644
+--- a/bcache.c
++++ b/bcache.c
+@@ -26,7 +26,7 @@
+  * x^7 + x^4 + x + 1
+ */
+ 
+-static const uint64_t crc_table[256] = {
++const uint64_t crc_table[256] = {
+ 	0x0000000000000000ULL, 0x42F0E1EBA9EA3693ULL, 0x85E1C3D753D46D26ULL,
+ 	0xC711223CFA3E5BB5ULL, 0x493366450E42ECDFULL, 0x0BC387AEA7A8DA4CULL,
+ 	0xCCD2A5925D9681F9ULL, 0x8E224479F47CB76AULL, 0x9266CC8A1C85D9BEULL,
+@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = {
+ 	0x9AFCE626CE85B507ULL
+ };
+ 
+-inline uint64_t crc64(const void *_data, size_t len)
++uint64_t crc64(const void *_data, size_t len)
+ {
+ 	uint64_t crc = 0xFFFFFFFFFFFFFFFFULL;
+ 	const unsigned char *data = _data;
diff --git a/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix
new file mode 100644
index 000000000000..a28499f77328
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, attr, libuuid, libscrypt, libsodium, keyutils
+, liburcu, zlib, libaio, udev, zstd, lz4, valgrind, python3Packages, nixosTests
+, fuseSupport ? false, fuse3 ? null }:
+
+assert fuseSupport -> fuse3 != null;
+
+stdenv.mkDerivation {
+  pname = "bcachefs-tools";
+  version = "2020-11-17";
+
+  src = fetchFromGitHub {
+    owner = "koverstreet";
+    repo = "bcachefs-tools";
+    rev = "41bec63b265a38dd9fa168b6042ea5bf07135048";
+    sha256 = "1y3187kpw1bmnl97isv28k2sw8cmrnsn31a0dw745adwm0n7z6fj";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "pytest-3" "pytest --verbose" \
+      --replace "INITRAMFS_DIR=/etc/initramfs-tools" \
+                "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools"
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    libuuid libscrypt libsodium keyutils liburcu zlib libaio
+    zstd lz4 python3Packages.pytest udev valgrind
+  ] ++ lib.optional fuseSupport fuse3;
+
+  doCheck = false; # needs bcachefs module loaded on builder
+  checkFlags = [ "BCACHEFS_TEST_USE_VALGRIND=no" ];
+  checkInputs = [ valgrind ];
+
+  preCheck = lib.optionalString fuseSupport ''
+    rm tests/test_fuse.py
+  '';
+
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  passthru.tests = {
+    smoke-test = nixosTests.bcachefs;
+  };
+
+  meta = with lib; {
+    description = "Tool for managing bcachefs filesystems";
+    homepage = "https://bcachefs.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ davidak chiiruno ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper b/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper
new file mode 100755
index 000000000000..67c95e8f8031
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper
@@ -0,0 +1,227 @@
+#!@bash@/bin/bash
+PATH=@bash@/bin:@coreutils@/bin:@utillinux@/bin:@btrfsProgs@/bin:$PATH
+beesd_bin=@bees@/lib/bees/bees
+# PLEASE KEEP NIX-ISMS ABOVE THIS LINE TO EASE UPSTREAM MERGE
+#!/usr/bin/env bash
+
+shopt -s extglob
+
+# Upstream wrapper requires UUID to be used for configuration.
+
+# However, when declaratively describing a host, we may not know its UUID, and
+# shouldn't need to persist something that will differ between hosts built from
+# the same configuration template.
+
+# Thus, for using bees from NixOS, we have our own wrapper, which supports not
+# just UUID but any specification permitted by findmnt
+
+[[ $bees_debug ]] && { PS4=':${BASH_SOURCE##*/}:$LINENO+'; set -x; }
+
+usage() {
+  cat >&2 <<EOF
+Usage: ${BASH_SOURCE##*/} run|cleanup config-name|fsSpec [idxSizeMB=...] [verbosity=...] [workDir=...] [-- daemon-options...]
+
+  fsSpec should be in a format recognized by findmnt. Alternately,
+  "config-name" may refer to a file that exists in ${bees_config_dir:-/etc/bees}
+  with a .conf extension; if that file does not specify UUID, findmnt will be
+  used in addition.
+
+  Note that while config files may presently use shell arithmetic, use of this
+  functionality is not encouraged going forward: Setting ''idxSizeMB=4096'' is
+  preferred over ''DB_SIZE=$((1024*1024*1024*4))'' or ''DB_SIZE=$(( AL16M * 256 ))'',
+  although both of these are presently supported.
+
+  If fsSpec contains a /, it assumed to be a mount point to be looked up by
+  findmnt, not a config file name.
+
+  daemon-options are passed directly through to the daemon on startup, as
+  documented at https://github.com/Zygo/bees/blob/master/docs/options.md.
+EOF
+  exit 1
+}
+
+die() { echo "$*" >&2; exit 1; }
+
+allConfigNames=( blockdev fsSpec home idxSize idxSizeMB mntDir runDir status verbosity workDir )
+
+# Alternate names for configuration values; "bees_" will always be prepended
+declare -A altConfigNames=(
+  # from original bees wrapper
+  [BEESHOME]=home
+  [BEESSTATUS]=status
+  [MNT_DIR]=mntDir
+  [UUID]=uuid
+  [WORK_DIR]=runDir
+  [DB_SIZE]=idxSize
+)
+
+# legacy bees config files can be arbitrary shell scripts, so we need to actually evaluate them
+sandboxedConfigFileEval() {
+  bash_exe=$(type -P bash) || exit
+  PATH=/var/empty ENV='' BASH_ENV='' AL128K="$((128*1024))" AL16M="$((16*1024*1024))" "$bash_exe" -r ${bees_debug+-x} \
+    -c 'eval "$(</dev/stdin)" >&2; for var; do [[ ${!var} ]] && printf "%q=%s\\0" "$var" "${!var}"; done' \
+    "${!altConfigNames[@]}" "${allConfigNames[@]}" \
+    <"$1"
+}
+
+readConfigFileIfExists() {
+  local line
+  [[ -s $1 ]] || return 1
+  while IFS= read -r -d '' line; do
+    line=${line%%+([[:space:]])"#"*}
+    [[ $line ]] || continue
+    [[ $line = *=* ]] || {
+      printf 'WARNING: Config file line not recognized: %q\n' "$line" >&2
+      continue
+    }
+    set_option "$line"
+  done < <(sandboxedConfigFileEval "$1")
+}
+
+set_option() {
+  local k v
+  k="${1%%=*}" v="${1#*=}"
+  [[ ${altConfigNames[$k]} ]] && k=${altConfigNames[$k]}
+  printf -v "bees_$k" %s "$v"
+}
+
+uuid_re='^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$'
+
+# Shared code for setting configuration used by other operations.
+#
+# Reads from global associative array "opts" containing options passed in as
+# key=value pairs on the command line, looks for config-file overrides, and
+# sets individual global variables.
+_setup() {
+  declare fstype
+  bees_fsSpec=$1; shift
+
+  # Look for file-based configuration, additional to honoring configuration on the command line
+  bees_config_dir="${bees_config_dir:-/etc/bees}"
+  if [[ $bees_fsSpec =~ $uuid_re ]]; then
+    bees_uuid=$bees_fsSpec
+    # If our spec looks like a bare UUID, and no config file exists in the new
+    # format, fall back to legacy config file search mechanism (grep; ewww).
+    if ! readConfigFileIfExists "$bees_config_dir/UUID=$bees_fsSpec.conf"; then
+      # Legacy approach to finding a config file: Grep for a *.conf file
+      # containing the UUID within its text. Permitting spaces around the "="
+      # appears to be a bug, but is retained for compatibility with the
+      # original upstream script.
+      allConfFiles=( "$bees_config_dir"/*.conf )
+      if (( ${#allConfFiles[@]} )); then
+        # in read or readarray with -d '', the NUL terminating the empty string is used as delimiter character.
+        readarray -d '' -t matchingConfFiles < <(grep -E -l -Z "^[^#]*UUID[[:space:]]*=[[:space:]]*" "${allConfFiles[@]}")
+      else
+        matchingConfFiles=( )
+      fi
+      if (( ${#matchingConfFiles[@]} == 1 )); then
+        # Exactly one configuration file exists in our target directory with a reference to the UUID given.
+        bees_config_file=${matchingConfFiles[0]}
+        readConfigFileIfExists "$bees_config_file"
+        echo "NOTE: Please consider renaming $bees_config_file to $bees_config_dir/UUID=$bees_fsSpec" >&2
+        echo "      ...and passing UUID=$bees_fsSpec on startup." >&2
+      elif (( ${#matchingConfFiles[@]} > 1 )); then
+        # The legacy wrapper would silently use the first file and ignore
+        # others, but... no.
+        echo "ERROR: Passed a bare UUID, but multiple configuration files match it:" >&2
+        printf ' - %q\n' "${matchingConfFiles[@]}" >&2
+        die "Unable to continue."
+      fi
+    fi
+  else
+    # For a non-UUID fsSpec that is not a path, look only for a config file
+    # exactly matching its text.
+    #
+    # (Passing a mount point as a fsSpec is only supported with the new
+    # wrapper; all key=value pairs can be passed on the command line in this
+    # mode, so config file support is not needed).
+    [[ $bees_fsSpec = */* ]] || readConfigFileIfExists "$bees_config_dir/$bees_fsSpec.conf"
+  fi
+
+  [[ $bees_uuid ]] || {
+    # if bees_uuid is not in our .conf file, look it up with findmnt
+    for findmnt_mode in --kernel --mtab --fstab; do
+      read -r bees_uuid fstype < <(findmnt "$findmnt_mode" -n -o uuid,fstype "$bees_fsSpec") ||:
+      [[ $bees_uuid && $fstype ]] && break
+    done
+    [[ $bees_uuid ]] || die "Unable to identify a device matching $bees_fsSpec with findmnt"
+    [[ $fstype = btrfs ]] || die "Device type is $fstype, not btrfs"
+  }
+
+  [[ $bees_uuid = */* ]] || readConfigFileIfExists "$bees_config_dir/UUID=$bees_uuid.conf"
+
+  # Honor any values read from config files above; otherwise, set defaults.
+  bees_workDir="${bees_workDir:-.beeshome}"
+  bees_runDir="${bees_runDir:-/run/bees}"
+  bees_mntDir="${bees_mntDir:-$bees_runDir/mnt/$bees_uuid}"
+  bees_home="${bees_home:-$bees_mntDir/$bees_workDir}"
+  bees_status="${bees_status:-${bees_runDir}/$bees_uuid.status}"
+  bees_verbosity="${bees_verbosity:-6}"
+  bees_idxSizeMB="${bees_idxSizeMB:-1024}"
+  bees_idxSize=${bees_idxSize:-"$(( bees_idxSizeMB * 1024 * 1024 ))"}
+  bees_blockdev=${bees_blockdev:-"/dev/disk/by-uuid/$bees_uuid"}
+
+  [[ -b $bees_blockdev ]] || die "Block device $bees_blockdev missing"
+  (( bees_idxSize % (16 * 1024 * 1024) == 0 )) || die "DB size must be divisible by 16MB"
+}
+
+do_run() {
+  local db old_db_size
+
+  _setup "$1"; shift
+  mkdir -p -- "$bees_mntDir" || exit
+
+  # subvol id 5 is reserved for the root subvolume of a btrfs filesystem.
+  mountpoint -q "$bees_mntDir" || mount -osubvolid=5 -- "$bees_blockdev" "$bees_mntDir" || exit
+  if [[ -d $bees_home ]]; then
+    btrfs subvolume show "$bees_home" >/dev/null 2>&1 || die "$bees_home exists but is not a subvolume"
+  else
+    btrfs subvolume create "$bees_home" || exit
+    sync # workaround for Zygo/bees#93
+  fi
+  db=$bees_home/beeshash.dat
+  touch -- "$db"
+
+  old_db_size=$(stat -c %s -- "$db")
+  new_db_size=$bees_idxSize
+
+  if (( old_db_size != new_db_size )); then
+    rm -f -- "$bees_home"/beescrawl."$bees_uuid".dat
+    truncate -s "$new_db_size" -- "$db" || exit
+  fi
+  chmod 700 -- "$bees_home"
+
+  # BEESSTATUS and BEESHOME are the only variables handled by the legacy
+  # wrapper for which getenv() is called in C code.
+  BEESSTATUS=$bees_status BEESHOME=$bees_home exec "${beesd_bin:-/lib/bees/bees}" \
+    --verbose "$bees_verbosity" \
+    "$@" "$bees_mntDir" || exit
+}
+
+do_cleanup() {
+  _setup "$1"; shift
+  mountpoint -q "$bees_mntDir" && umount -l -- "$bees_mntDir" || exit
+}
+
+(( $# >= 2 )) || usage
+declare -f "do_$1" >/dev/null 2>&1 || usage
+mode=$1; shift # must be a do_* function; currently "run" or "cleanup"
+
+declare -a args=( "$1" ); shift  # pass first argument (config-name|fsSpec) through literally
+
+# parse other arguments as key=value pairs, or pass them through literally if they do not match that form.
+# similarly, any option after "--" will be passed through literally.
+while (( $# )); do
+  if [[ $1 = *=* ]]; then
+    set_option "$1"
+  elif [[ $1 = -- ]]; then
+    shift
+    args+=( "$@" )
+    break
+  else
+    args+=( "$1" )
+  fi
+  shift
+done
+
+"do_$mode" "${args[@]}"
diff --git a/nixpkgs/pkgs/tools/filesystems/bees/default.nix b/nixpkgs/pkgs/tools/filesystems/bees/default.nix
new file mode 100644
index 000000000000..c82ea23debd9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bees/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, stdenv
+, runCommand
+, fetchFromGitHub
+, bash
+, btrfs-progs
+, coreutils
+, python3Packages
+, util-linux
+, nixosTests
+}:
+
+let
+
+  bees = stdenv.mkDerivation rec {
+    pname = "bees";
+    version = "0.6.5";
+
+    src = fetchFromGitHub {
+      owner = "Zygo";
+      repo = "bees";
+      rev = "v${version}";
+      sha256 = "11ppbf23b8ngzfy02am0skxlybzmgsp6kna21jimb01x9pp1q7l7";
+    };
+
+    buildInputs = [
+      btrfs-progs # for btrfs/ioctl.h
+      util-linux # for uuid.h
+    ];
+
+    nativeBuildInputs = [
+      python3Packages.markdown # documentation build
+    ];
+
+    preBuild = ''
+      git() { if [[ $1 = describe ]]; then echo ${version}; else command git "$@"; fi; }
+      export -f git
+    '';
+
+    postBuild = ''
+      unset -f git
+    '';
+
+    buildFlags = [
+      "ETC_PREFIX=/var/run/bees/configs"
+    ];
+
+    makeFlags = [
+      "SHELL=bash"
+      "PREFIX=$(out)"
+      "ETC_PREFIX=$(out)/etc"
+      "BEES_VERSION=${version}"
+      "SYSTEMD_SYSTEM_UNIT_DIR=$(out)/etc/systemd/system"
+    ];
+
+    meta = with lib; {
+      homepage = "https://github.com/Zygo/bees";
+      description = "Block-oriented BTRFS deduplication service";
+      license = licenses.gpl3;
+      platforms = platforms.linux;
+      maintainers = with maintainers; [ chaduffy ];
+      longDescription = "Best-Effort Extent-Same: bees finds not just identical files, but also identical extents within files that differ";
+    };
+  };
+
+in
+
+(runCommand "bees-service"
+  {
+    inherit bash bees coreutils;
+    utillinux = util-linux; # needs to be a valid shell variable name
+    btrfsProgs = btrfs-progs; # needs to be a valid shell variable name
+  } ''
+  mkdir -p -- "$out/bin"
+  substituteAll ${./bees-service-wrapper} "$out"/bin/bees-service-wrapper
+  chmod +x "$out"/bin/bees-service-wrapper
+  ln -s ${bees}/bin/beesd "$out"/bin/beesd
+'').overrideAttrs (old: {
+  passthru.tests = {
+    smoke-test = nixosTests.bees;
+  };
+})
diff --git a/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix b/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix
new file mode 100644
index 000000000000..12052100db32
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, fuse, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "1.15.1";
+  pname = "bindfs";
+
+  src = fetchurl {
+    url    = "https://bindfs.org/downloads/${pname}-${version}.tar.gz";
+    sha256 = "sha256-BN01hKbN+a9DRNQDxiGFyp+rMc465aJdAQG8EJNsaKs=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse ];
+  postFixup = ''
+    ln -s $out/bin/bindfs $out/bin/mount.fuse.bindfs
+  '';
+
+  meta = {
+    description = "A FUSE filesystem for mounting a directory to another location";
+    homepage    = "https://bindfs.org";
+    license     = lib.licenses.gpl2Only;
+    maintainers = with lib.maintainers; [ lovek323 lovesegfault ];
+    platforms   = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix
new file mode 100644
index 000000000000..a620a07d4753
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, curl, gnutls, libgcrypt, libuuid, fuse, boost }:
+
+let
+  version = "1.3.7";
+  src = fetchFromGitHub {
+    owner  = "Azure";
+    repo   = "azure-storage-fuse";
+    rev    = "blobfuse-${version}-Linux";
+    sha256 = "sha256-yihIuS4AG489U7eBi/p7H6S7Cg54kkQeNVCexxQZ60A=";
+  };
+  cpplite = stdenv.mkDerivation rec {
+    pname = "cpplite";
+    inherit version src;
+
+    sourceRoot = "source/cpplite";
+    patches = [ ./install-adls.patch ];
+
+    cmakeFlags = [ "-DBUILD_ADLS=ON" "-DUSE_OPENSSL=OFF" ];
+
+    buildInputs = [ curl libuuid gnutls ];
+    nativeBuildInputs = [ cmake pkg-config ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "blobfuse";
+  inherit version src;
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
+
+  buildInputs = [ curl gnutls libgcrypt libuuid fuse boost cpplite ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "Mount an Azure Blob storage as filesystem through FUSE";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jbgi ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/blobfuse/install-adls.patch b/nixpkgs/pkgs/tools/filesystems/blobfuse/install-adls.patch
new file mode 100644
index 000000000000..e48f4d592f68
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/blobfuse/install-adls.patch
@@ -0,0 +1,14 @@
+diff --git a/adls/CMakeLists.txt b/adls/CMakeLists.txt
+index 1fb7146..22e663a 100644
+--- a/adls/CMakeLists.txt
++++ b/adls/CMakeLists.txt
+@@ -50,3 +50,9 @@ if(BUILD_TESTS)
+   string(REGEX REPLACE "([^;]+)" "${CMAKE_CURRENT_SOURCE_DIR}/\\1" AZURE_STORAGE_ADLS_TEST_SOURCES "${AZURE_STORAGE_ADLS_TEST_SOURCES}")
+   set(AZURE_STORAGE_ADLS_TEST_SOURCES ${AZURE_STORAGE_ADLS_TEST_SOURCES} PARENT_SCOPE)
+ endif()
++
++install(TARGETS azure-storage-adls
++        ARCHIVE DESTINATION lib
++        LIBRARY DESTINATION lib
++        RUNTIME DESTINATION bin)
++
diff --git a/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix b/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix
new file mode 100644
index 000000000000..e34e5289ad64
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, perl }:
+
+stdenv.mkDerivation rec {
+  name = "bonnie++-1.98";
+  src = fetchurl {
+    url = "https://www.coker.com.au/bonnie++/${name}.tgz";
+    sha256 = "010bmlmi0nrlp3aq7p624sfaj5a65lswnyyxk3cnz1bqig0cn2vf";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ perl ];
+
+  meta = {
+    homepage = "http://www.coker.com.au/bonnie++/";
+    description = "Hard drive and file system benchmark suite";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix b/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix
new file mode 100644
index 000000000000..ef611afd5d09
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchFromGitHub, curl, fuse, libxml2, pkg-config }:
+
+let
+  srcs = {
+    boxfs2 = fetchFromGitHub {
+      sha256 = "10af1l3sjnh25shmq5gdnpyqk4vrq7i1zklv4csf1n2nrahln8j8";
+      rev = "d7018b0546d2dae956ae3da3fb95d2f63fa6d3ff";
+      repo = "boxfs2";
+      owner = "drotiro";
+    };
+    libapp = fetchFromGitHub {
+      sha256 = "1p2sbxiranan2n2xsfjkp3c6r2vcs57ds6qvjv4crs1yhxr7cp00";
+      rev = "febebe2bc0fb88d57bdf4eb4a2a54c9eeda3f3d8";
+      repo = "libapp";
+      owner = "drotiro";
+    };
+    libjson = fetchFromGitHub {
+      sha256 = "1vhss3gq44nl61fbnh1l3qzwvz623gwhfgykf1lf1p31rjr7273w";
+      rev = "75a7f50fca2c667bc5f32cdd6dd98f2b673f6657";
+      repo = "libjson";
+      owner = "vincenthz";
+    };
+  };
+in stdenv.mkDerivation {
+  pname = "boxfs";
+  version = "2-20150109";
+
+  src = srcs.boxfs2;
+
+  prePatch = with srcs; ''
+    substituteInPlace Makefile --replace "git pull" "true"
+    cp -a --no-preserve=mode ${libapp} libapp
+    cp -a --no-preserve=mode ${libjson} libjson
+  '';
+  patches = [ ./work-around-API-borkage.patch ];
+
+  buildInputs = [ curl fuse libxml2 ];
+  nativeBuildInputs = [ pkg-config ];
+
+  buildFlags = [
+    "static"
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ] ++ lib.optional stdenv.isDarwin "CFLAGS=-D_BSD_SOURCE";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install boxfs boxfs-init $out/bin
+  '';
+
+  meta = with lib; {
+    description = "FUSE file system for box.com accounts";
+    longDescription = ''
+      Store files on box.com (an account is required). The first time you run
+      boxfs, you will need to complete the authentication (oauth2) process and
+      grant access to your box.com account. Just follow the instructions on
+      the terminal and in your browser. When you've done using your files,
+      unmount the file system with `fusermount -u mountpoint`.
+    '';
+    homepage = "https://github.com/drotiro/boxfs2";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch b/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch
new file mode 100644
index 000000000000..b74e7f324665
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch
@@ -0,0 +1,15 @@
+diff --git a/boxapi.c b/boxapi.c
+index 4964273..1a32e0d 100644
+--- a/boxapi.c
++++ b/boxapi.c
+@@ -38,8 +38,8 @@
+ //    AUTH
+ #define API_KEY_VAL "f9ss11y2w0hg5r04jsidxlhk4pil28cf"
+ #define API_SECRET  "r3ZHAIhsOL2FoHjgERI9xf74W5skIM0w"
+-#define API_OAUTH_URL "https://app.box.com/api/oauth2/" //"https://www.box.com/api/oauth2/"
+-#define API_OAUTH_AUTHORIZE API_OAUTH_URL "authorize?response_type=code&client_id=" API_KEY_VAL /*"&redirect_uri=http%3A//localhost"*/
++#define API_OAUTH_URL "https://api.box.com/oauth2/" //"https://www.box.com/api/oauth2/"
++#define API_OAUTH_AUTHORIZE "https://app.box.com/api/oauth2/authorize?response_type=code&client_id=" API_KEY_VAL /*"&redirect_uri=http%3A//localhost"*/
+ #define API_OAUTH_TOKEN     API_OAUTH_URL "token"
+ //    CALLS
+ #define API_ENDPOINT	"https://api.box.com/2.0/"
diff --git a/nixpkgs/pkgs/tools/filesystems/btrfs-heatmap/default.nix b/nixpkgs/pkgs/tools/filesystems/btrfs-heatmap/default.nix
new file mode 100644
index 000000000000..9de91738e74d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/btrfs-heatmap/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib
+, fetchFromGitHub
+, python3
+, installShellFiles
+}:
+
+stdenv.mkDerivation rec {
+  pname = "btrfs-heatmap";
+  version = "9";
+
+  src = fetchFromGitHub {
+    owner = "knorrie";
+    repo = "btrfs-heatmap";
+    rev = "v${version}";
+    sha256 = "sha256-yCkuZqWwxrs2eS7EXY6pAOVVVSq7dAMxJtf581gX8vg=";
+  };
+
+  buildInputs = [ python3 ];
+  nativeBuildInputs = [ python3.pkgs.wrapPython installShellFiles ];
+
+  outputs = [ "out" "man" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm 0755 btrfs-heatmap $out/sbin/btrfs-heatmap
+    installManPage man/btrfs-heatmap.1
+
+    buildPythonPath ${python3.pkgs.btrfs}
+    patchPythonScript $out/sbin/btrfs-heatmap
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Visualize the layout of a mounted btrfs";
+    homepage = "https://github.com/knorrie/btrfs-heatmap";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.evils ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix b/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix
new file mode 100644
index 000000000000..9a05a0d67fec
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, pkg-config, attr, acl, zlib, libuuid, e2fsprogs, lzo
+, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "btrfs-progs";
+  version = "5.11.1";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
+    sha256 = "sha256-46rMxHVuxOVQLLKp+Ftn1SiWZE9MPA+IprxZjHC96/4=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt
+    python3 python3.pkgs.setuptools
+  ];
+
+  buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python3 ];
+
+  # for python cross-compiling
+  _PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config;
+
+  # gcc bug with -O1 on ARM with gcc 4.8
+  # This should be fine on all platforms so apply universally
+  postPatch = "sed -i s/-O1/-O2/ configure";
+
+  postInstall = ''
+    install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs
+  '';
+
+  configureFlags = lib.optional stdenv.hostPlatform.isMusl "--disable-backtrace";
+
+  meta = with lib; {
+    description = "Utilities for the btrfs filesystem";
+    homepage = "https://btrfs.wiki.kernel.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix b/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix
new file mode 100644
index 000000000000..aa0f317787f8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix
@@ -0,0 +1,30 @@
+{ lib, python2 }:
+
+python2.pkgs.buildPythonApplication rec {
+  pname = "buttersink";
+  version = "0.6.9";
+
+  src = python2.pkgs.fetchPypi {
+    inherit pname version;
+    sha256 = "a797b6e92ad2acdf41e033c1368ab365aa268f4d8458b396a5770fa6c2bc3f54";
+  };
+
+  propagatedBuildInputs = with python2.pkgs; [ boto crcmod psutil ];
+
+  # No tests implemented
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Synchronise btrfs snapshots";
+    longDescription = ''
+      ButterSink is like rsync, but for btrfs subvolumes instead of files,
+      which makes it much more efficient for things like archiving backup
+      snapshots. It is built on top of btrfs send and receive capabilities.
+      Sources and destinations can be local btrfs file systems, remote btrfs
+      file systems over SSH, or S3 buckets.
+    '';
+    homepage = "https://github.com/AmesCornish/buttersink/wiki";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/catcli/default.nix b/nixpkgs/pkgs/tools/filesystems/catcli/default.nix
new file mode 100644
index 000000000000..be9349daa27c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/catcli/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, fetchFromGitHub
+, buildPythonApplication
+, docopt, anytree
+}:
+
+buildPythonApplication rec {
+
+  pname = "catcli";
+  version = "0.6.2";
+
+  src = fetchFromGitHub {
+    owner = "deadc0de6";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0704022gbm987q6x6vcflq4b4p4hvcqm5ikiyndy5n8fj1q8lq95";
+  };
+
+  propagatedBuildInputs = [ docopt anytree ];
+
+  postPatch = "patchShebangs . ";
+
+  meta = with lib; {
+    description = "The command line catalog tool for your offline data";
+    homepage = "https://github.com/deadc0de6/catcli";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ petersjt014 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch b/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch
new file mode 100644
index 000000000000..a117408b000f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch
@@ -0,0 +1,11 @@
+--- a/cmake/modules/BuildSPDK.cmake
++++ b/cmake/modules/BuildSPDK.cmake
+@@ -35,7 +35,7 @@ macro(build_spdk)
+     # unset $CFLAGS, otherwise it will interfere with how SPDK sets
+     # its include directory.
+     # unset $LDFLAGS, otherwise SPDK will fail to mock some functions.
+-    BUILD_COMMAND env -i PATH=$ENV{PATH} CC=${CMAKE_C_COMPILER} ${make_cmd} EXTRA_CFLAGS="${spdk_CFLAGS}"
++    BUILD_COMMAND env -i PATH=$ENV{PATH} CC=${CMAKE_C_COMPILER} ${make_cmd} EXTRA_CFLAGS="${spdk_CFLAGS}" C_OPT="-mssse3"
+     BUILD_IN_SOURCE 1
+     INSTALL_COMMAND "true")
+   unset(make_cmd)
diff --git a/nixpkgs/pkgs/tools/filesystems/ceph/default.nix b/nixpkgs/pkgs/tools/filesystems/ceph/default.nix
new file mode 100644
index 000000000000..52bce3f274df
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ceph/default.nix
@@ -0,0 +1,238 @@
+{ lib, stdenv, runCommand, fetchurl
+, ensureNewerSourcesHook
+, cmake, pkg-config
+, which, git
+, boost, python3Packages
+, libxml2, zlib, lz4
+, openldap, lttng-ust
+, babeltrace, gperf
+, gtest
+, cunit, snappy
+, makeWrapper
+, leveldb, oathToolkit
+, libnl, libcap_ng
+, rdkafka
+, nixosTests
+, cryptsetup
+, sqlite
+, lua
+, icu
+, bzip2
+, doxygen
+, graphviz
+, fmt
+, python3
+
+# Optional Dependencies
+, yasm ? null, fcgi ? null, expat ? null
+, curl ? null, fuse ? null
+, libedit ? null, libatomic_ops ? null
+, libs3 ? null
+
+# Mallocs
+, jemalloc ? null, gperftools ? null
+
+# Crypto Dependencies
+, cryptopp ? null
+, nss ? null, nspr ? null
+
+# Linux Only Dependencies
+, linuxHeaders, util-linux, libuuid, udev, keyutils, rdma-core, rabbitmq-c
+, libaio ? null, libxfs ? null, zfs ? null
+, ...
+}:
+
+# We must have one crypto library
+assert cryptopp != null || (nss != null && nspr != null);
+
+let
+  shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null;
+
+  optYasm = shouldUsePkg yasm;
+  optFcgi = shouldUsePkg fcgi;
+  optExpat = shouldUsePkg expat;
+  optCurl = shouldUsePkg curl;
+  optFuse = shouldUsePkg fuse;
+  optLibedit = shouldUsePkg libedit;
+  optLibatomic_ops = shouldUsePkg libatomic_ops;
+  optLibs3 = shouldUsePkg libs3;
+
+  optJemalloc = shouldUsePkg jemalloc;
+  optGperftools = shouldUsePkg gperftools;
+
+  optCryptopp = shouldUsePkg cryptopp;
+  optNss = shouldUsePkg nss;
+  optNspr = shouldUsePkg nspr;
+
+  optLibaio = shouldUsePkg libaio;
+  optLibxfs = shouldUsePkg libxfs;
+  optZfs = shouldUsePkg zfs;
+
+  hasRadosgw = optFcgi != null && optExpat != null && optCurl != null && optLibedit != null;
+
+
+  # Malloc implementation (can be jemalloc, tcmalloc or null)
+  malloc = if optJemalloc != null then optJemalloc else optGperftools;
+
+  # We prefer nss over cryptopp
+  cryptoStr = if optNss != null && optNspr != null then "nss" else
+    if optCryptopp != null then "cryptopp" else "none";
+
+  cryptoLibsMap = {
+    nss = [ optNss optNspr ];
+    cryptopp = [ optCryptopp ];
+    none = [ ];
+  };
+
+  getMeta = description: with lib; {
+     homepage = "https://ceph.com/";
+     inherit description;
+     license = with licenses; [ lgpl21 gpl2 bsd3 mit publicDomain ];
+     maintainers = with maintainers; [ adev ak johanot krav ];
+     platforms = [ "x86_64-linux" "aarch64-linux" ];
+   };
+
+  ceph-common = python3Packages.buildPythonPackage rec{
+    pname = "ceph-common";
+    inherit src version;
+
+    sourceRoot = "ceph-${version}/src/python-common";
+
+    checkInputs = [ python3Packages.pytest ];
+    propagatedBuildInputs = with python3Packages; [ pyyaml six ];
+
+    meta = getMeta "Ceph common module for code shared by manager modules";
+  };
+
+  ceph-python-env = python3Packages.python.withPackages (ps: [
+    ps.sphinx
+    ps.flask
+    ps.cython
+    ps.setuptools
+    ps.virtualenv
+    # Libraries needed by the python tools
+    ps.Mako
+    ceph-common
+    ps.cherrypy
+    ps.dateutil
+    ps.jsonpatch
+    ps.pecan
+    ps.prettytable
+    ps.pyopenssl
+    ps.pyjwt
+    ps.webob
+    ps.bcrypt
+    # scipy > 1.3 breaks diskprediction_local, leading to mgr hang on startup
+    # Bump (and get rid of scipy_1_3) once these issues are resolved:
+    # https://tracker.ceph.com/issues/42764 https://tracker.ceph.com/issues/45147
+    ps.scipy_1_3
+    ps.six
+    ps.pyyaml
+  ]);
+  sitePackages = ceph-python-env.python.sitePackages;
+
+  version = "16.2.4";
+  src = fetchurl {
+    url = "http://download.ceph.com/tarballs/ceph-${version}.tar.gz";
+    sha256 = "sha256-J6FVK7feNN8cGO5BSDlfRGACAzchmRUSWR+a4ZgeWy0=";
+  };
+in rec {
+  ceph = stdenv.mkDerivation {
+    pname = "ceph";
+    inherit src version;
+
+    patches = [
+      ./0000-fix-SPDK-build-env.patch
+    ];
+
+    nativeBuildInputs = [
+      cmake
+      pkg-config which git python3Packages.wrapPython makeWrapper
+      python3Packages.python # for the toPythonPath function
+      (ensureNewerSourcesHook { year = "1980"; })
+      python3
+      fmt
+      # for building docs/man-pages presumably
+      doxygen
+      graphviz
+    ];
+
+    buildInputs = cryptoLibsMap.${cryptoStr} ++ [
+      boost ceph-python-env libxml2 optYasm optLibatomic_ops optLibs3
+      malloc zlib openldap lttng-ust babeltrace gperf gtest cunit
+      snappy lz4 oathToolkit leveldb libnl libcap_ng rdkafka
+      cryptsetup sqlite lua icu bzip2
+    ] ++ lib.optionals stdenv.isLinux [
+      linuxHeaders util-linux libuuid udev keyutils optLibaio optLibxfs optZfs
+      # ceph 14
+      rdma-core rabbitmq-c
+    ] ++ lib.optionals hasRadosgw [
+      optFcgi optExpat optCurl optFuse optLibedit
+    ];
+
+    pythonPath = [ ceph-python-env "${placeholder "out"}/${ceph-python-env.sitePackages}" ];
+
+    preConfigure =''
+      substituteInPlace src/common/module.c --replace "/sbin/modinfo"  "modinfo"
+      substituteInPlace src/common/module.c --replace "/sbin/modprobe" "modprobe"
+      substituteInPlace src/common/module.c --replace "/bin/grep" "grep"
+
+      # for pybind/rgw to find internal dep
+      export LD_LIBRARY_PATH="$PWD/build/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+      # install target needs to be in PYTHONPATH for "*.pth support" check to succeed
+      # set PYTHONPATH, so the build system doesn't silently skip installing ceph-volume and others
+      export PYTHONPATH=${ceph-python-env}/${sitePackages}:$lib/${sitePackages}:$out/${sitePackages}
+      patchShebangs src/script src/spdk src/test src/tools
+    '';
+
+    cmakeFlags = [
+      "-DWITH_SYSTEM_ROCKSDB=OFF"  # breaks Bluestore
+      "-DCMAKE_INSTALL_DATADIR=${placeholder "lib"}/lib"
+
+      "-DWITH_SYSTEM_BOOST=ON"
+      "-DWITH_SYSTEM_GTEST=ON"
+      "-DMGR_PYTHON_VERSION=${ceph-python-env.python.pythonVersion}"
+      "-DWITH_SYSTEMD=OFF"
+      "-DWITH_TESTS=OFF"
+      # TODO breaks with sandbox, tries to download stuff with npm
+      "-DWITH_MGR_DASHBOARD_FRONTEND=OFF"
+      # WITH_XFS has been set default ON from Ceph 16, keeping it optional in nixpkgs for now
+      ''-DWITH_XFS=${if optLibxfs != null then "ON" else "OFF"}''
+    ];
+
+    postFixup = ''
+      wrapPythonPrograms
+      wrapProgram $out/bin/ceph-mgr --prefix PYTHONPATH ":" "$(toPythonPath ${placeholder "out"}):$(toPythonPath ${ceph-python-env})"
+
+      # Test that ceph-volume exists since the build system has a tendency to
+      # silently drop it with misconfigurations.
+      test -f $out/bin/ceph-volume
+    '';
+
+    outputs = [ "out" "lib" "dev" "doc" "man" ];
+
+    doCheck = false; # uses pip to install things from the internet
+
+    # Takes 7+h to build with 2 cores.
+    requiredSystemFeatures = [ "big-parallel" ];
+
+    meta = getMeta "Distributed storage system";
+
+    passthru.version = version;
+    passthru.tests = { inherit (nixosTests) ceph-single-node ceph-multi-node ceph-single-node-bluestore; };
+  };
+
+  ceph-client = runCommand "ceph-client-${version}" {
+      meta = getMeta "Tools needed to mount Ceph's RADOS Block Devices";
+    } ''
+      mkdir -p $out/{bin,etc,${sitePackages},share/bash-completion/completions}
+      cp -r ${ceph}/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $out/bin
+      cp -r ${ceph}/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $out/bin
+      cp -r ${ceph}/bin/rbd-replay* $out/bin
+      cp -r ${ceph}/${sitePackages} $out/${sitePackages}
+      cp -r ${ceph}/etc/bash_completion.d $out/share/bash-completion/completions
+      # wrapPythonPrograms modifies .ceph-wrapped, so lets just update its paths
+      substituteInPlace $out/bin/ceph          --replace ${ceph} $out
+      substituteInPlace $out/bin/.ceph-wrapped --replace ${ceph} $out
+   '';
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix b/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix
new file mode 100644
index 000000000000..e4a20e3da5a0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, perl, fuse }:
+
+stdenv.mkDerivation rec {
+  version = "0.7";
+  pname = "chunkfs";
+
+  src = fetchurl {
+    url = "https://chunkfs.florz.de/chunkfs_${version}.tar.gz";
+    sha256 = "4c168fc2b265a6ba34afc565707ea738f34375325763c0596f2cfa1c9b8d40f1";
+  };
+
+  buildInputs = [perl fuse];
+
+  makeFlags = [
+    "DESTDIR=$(out)"
+    "PREFIX="
+  ];
+
+  preInstall = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+  '';
+
+  meta = {
+    description = "FUSE filesystems for viewing chunksync-style directory trees as a block device and vice versa";
+    homepage = "http://chunkfs.florz.de/";
+    license = lib.licenses.gpl2;
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix b/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix
new file mode 100644
index 000000000000..cfe80cfce65e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse, glib, attr }:
+
+stdenv.mkDerivation rec {
+  name = "ciopfs-0.4";
+
+  src = fetchurl {
+    url = "http://www.brain-dump.org/projects/ciopfs/${name}.tar.gz";
+    sha256 = "0sr9i9b3qfwbfvzvk00yrrg3x2xqk1njadbldkvn7hwwa4z5bm9l";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse glib attr ];
+
+  makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
+
+  meta = {
+    homepage = "https://www.brain-dump.org/projects/ciopfs/";
+    description = "A case-insensitive filesystem layered on top of any other filesystem";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/convoy/default.nix b/nixpkgs/pkgs/tools/filesystems/convoy/default.nix
new file mode 100644
index 000000000000..774568fdde17
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/convoy/default.nix
@@ -0,0 +1,26 @@
+# This file was generated by go2nix.
+{ lib, buildGoPackage, fetchFromGitHub, lvm2 }:
+
+buildGoPackage rec {
+  pname = "convoy";
+  version = "0.5.2";
+
+  goPackagePath = "github.com/rancher/convoy";
+
+  src = fetchFromGitHub {
+    rev = "v${version}";
+    owner = "rancher";
+    repo = "convoy";
+    sha256 = "09nygrxd5hril4xcfsvgjg74xxhhimznqq4sdk0f360c5ra0dbhj";
+  };
+
+  buildInputs = [lvm2];
+
+  meta = with lib; {
+    homepage = "https://github.com/rancher/convoy";
+    description = "A Docker volume plugin, managing persistent container volumes";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ offline ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix b/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix
new file mode 100644
index 000000000000..a439e29358f7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, ncurses, readline, ronn }:
+
+stdenv.mkDerivation rec {
+
+  pname = "cpcfs";
+  version = "0.85.4";
+
+  src = fetchFromGitHub {
+    owner = "derikz";
+    repo = "cpcfs";
+    rev = "v${version}";
+    sha256 = "0rfbry0qy8mv746mzk9zdfffkdgq4w7invgb5cszjma2cp83q3i2";
+  };
+
+  sourceRoot = "source/src";
+
+  nativeBuildInputs = [ makeWrapper ncurses readline ronn ];
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace '-ltermcap' '-lncurses' \
+      --replace '-L /usr/lib/termcap' ' '
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    mkdir -p $out/man/man1
+    cp cpcfs $out/bin
+    ronn --roff ../template.doc --pipe > $out/man/man1/cpcfs.1
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Manipulating CPC dsk images and files";
+    homepage = "https://github.com/derikz/cpcfs/" ;
+    license = licenses.bsd2;
+    maintainers = [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix b/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix
new file mode 100644
index 000000000000..0da6c4c20994
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix
@@ -0,0 +1,84 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch
+, cmake, pkg-config, python3, gtest
+, boost, cryptopp, curl, fuse, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cryfs";
+  version = "0.10.2";
+
+  src = fetchFromGitHub {
+    owner  = "cryfs";
+    repo   = "cryfs";
+    rev    = version;
+    sha256 = "1m6rcc82hbaiwcwcvf5xmxma8n0jal9zhcykv9xgwiax4ny0l8kz";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "cryfs-0.10.2-install-targets.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-install-targets.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44";
+      sha256 = "1jz6gpi1i7dnfm88a6n3mccwfmsmvg0d0bmp3fmqqrkbcg7in00l";
+    })
+    (fetchpatch {
+      name = "cryfs-0.10.2-unbundle-libs.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-unbundle-libs.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44";
+      sha256 = "0hzss5rawcjrh8iqzc40w5yjhxdqya4gbg6dzap70180s50mahzs";
+    })
+
+    # Backported from https://github.com/cryfs/cryfs/pull/378
+    ./use-macfuse.patch
+  ];
+
+  postPatch = ''
+    patchShebangs src
+
+    # remove tests that require network access:
+    substituteInPlace test/cpp-utils/CMakeLists.txt \
+      --replace "network/CurlHttpClientTest.cpp" "" \
+      --replace "network/FakeHttpClientTest.cpp" ""
+
+    # remove CLI test trying to access /dev/fuse
+    substituteInPlace test/cryfs-cli/CMakeLists.txt \
+      --replace "CliTest_IntegrityCheck.cpp" ""
+
+    # downsize large file test as 4.5G is too big for Hydra:
+    substituteInPlace test/cpp-utils/data/DataTest.cpp \
+      --replace "(4.5L*1024*1024*1024)" "(0.5L*1024*1024*1024)"
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config python3 ];
+
+  strictDeps = true;
+
+  buildInputs = [ boost cryptopp curl fuse openssl ];
+
+  checkInputs = [ gtest ];
+
+  cmakeFlags = [
+    "-DCRYFS_UPDATE_CHECKS:BOOL=FALSE"
+    "-DBoost_USE_STATIC_LIBS:BOOL=FALSE" # this option is case sensitive
+    "-DUSE_SYSTEM_LIBS:BOOL=TRUE"
+    "-DBUILD_TESTING:BOOL=${if doCheck then "TRUE" else "FALSE"}"
+  ] ++ lib.optional doCheck "-DCMAKE_PREFIX_PATH=${gtest.dev}/lib/cmake";
+
+  # macFUSE needs to be installed for the test to succeed on Darwin
+  doCheck = !stdenv.isDarwin;
+
+  checkPhase = ''
+    # Skip CMakeFiles directory and tests depending on fuse (does not work well with sandboxing)
+    SKIP_IMPURE_TESTS="CMakeFiles|fspp|my-gtest-main"
+
+    for t in $(ls -d test/*/ | egrep -v "$SKIP_IMPURE_TESTS"); do
+      "./$t$(basename $t)-test"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Cryptographic filesystem for the cloud";
+    homepage    = "https://www.cryfs.org";
+    license     = licenses.lgpl3;
+    maintainers = with maintainers; [ peterhoeg c0bw3b ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/cryfs/use-macfuse.patch b/nixpkgs/pkgs/tools/filesystems/cryfs/use-macfuse.patch
new file mode 100644
index 000000000000..47e7845cf3dc
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/cryfs/use-macfuse.patch
@@ -0,0 +1,207 @@
+diff --git a/.travisci/install.sh b/.travisci/install.sh
+index 9057a75b..2929c360 100755
+--- a/.travisci/install.sh
++++ b/.travisci/install.sh
+@@ -6,12 +6,11 @@ set -e
+ if [ "${CXX}" == "g++" ]; then
+     # We need to uninstall oclint because it creates a /usr/local/include/c++ symlink that clashes with the gcc5 package
+     # see https://github.com/Homebrew/homebrew-core/issues/21172
+-    brew cask uninstall oclint
++    brew uninstall oclint
+     brew install gcc@7
+ fi
+ 
+-brew cask install osxfuse
+-brew install libomp
++brew install libomp pkg-config macfuse
+ 
+ # By default, travis only fetches the newest 50 commits. We need more in case we're further from the last version tag, so the build doesn't fail because it can't generate the version number.
+ git fetch --unshallow --tags
+diff --git a/README.md b/README.md
+index b0f4a684..7001119a 100644
+--- a/README.md
++++ b/README.md
+@@ -19,7 +19,7 @@ OSX
+ 
+ CryFS is distributed via Homebrew. Just do
+ 
+-    brew cask install osxfuse
++    brew install osxfuse
+     brew install cryfs
+     
+ Windows (experimental)
+@@ -45,6 +45,7 @@ Requirements
+   - Git (for getting the source code)
+   - GCC version >= 5.0 or Clang >= 4.0
+   - CMake version >= 3.0 
++  - pkg-config (on Unix)
+   - libcurl4 (including development headers)
+   - Boost libraries version >= 1.65.1 (including development headers)
+     - filesystem
+@@ -53,20 +54,20 @@ Requirements
+     - program_options
+     - thread
+   - SSL development libraries (including development headers, e.g. libssl-dev)
+-  - libFUSE version >= 2.8.6 (including development headers), on Mac OS X instead install osxfuse from https://osxfuse.github.io/
++  - libFUSE version >= 2.8.6 (including development headers), on Mac OS X instead install macFUSE from https://osxfuse.github.io/
+   - Python >= 2.7
+   - OpenMP
+ 
+ You can use the following commands to install these requirements
+ 
+         # Ubuntu
+-        $ sudo apt install git g++ cmake make libcurl4-openssl-dev libboost-filesystem-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libboost-thread-dev libssl-dev libfuse-dev python
++        $ sudo apt install git g++ cmake make pkg-config libcurl4-openssl-dev libboost-filesystem-dev libboost-system-dev libboost-chrono-dev libboost-program-options-dev libboost-thread-dev libssl-dev libfuse-dev python
+ 
+         # Fedora
+-        sudo dnf install git gcc-c++ cmake make libcurl-devel boost-devel boost-static openssl-devel fuse-devel python
++        sudo dnf install git gcc-c++ cmake make pkgconf libcurl-devel boost-devel boost-static openssl-devel fuse-devel python
+ 
+         # Macintosh
+-        brew install cmake boost openssl libomp
++        brew install cmake pkg-config boost openssl libomp
+ 
+ Build & Install
+ ---------------
+@@ -116,17 +117,17 @@ On most systems, CMake should find the libraries automatically. However, that do
+ 
+         cmake .. -DBoost_USE_STATIC_LIBS=off
+ 
+-2. **Fuse/Osxfuse library not found**
++2. **Fuse library not found**
+ 
+     Pass in the library path with
+ 
+-        cmake .. -DFUSE_LIB_PATH=/path/to/fuse/or/osxfuse
++        PKG_CONFIG_PATH=/path-to-fuse-or-macFUSE/lib/pkgconfig cmake ..
+ 
+-3. **Fuse/Osxfuse headers not found**
++3. **Fuse headers not found**
+ 
+     Pass in the include path with
+ 
+-        cmake .. -DCMAKE_CXX_FLAGS="-I/path/to/fuse/or/osxfuse/headers"
++        PKG_CONFIG_PATH=/path-to-fuse-or-macFUSE/lib/pkgconfig cmake ..
+ 
+ 4. **Openssl headers not found**
+ 
+diff --git a/cmake-utils/utils.cmake b/cmake-utils/utils.cmake
+index da4dff8c..66021c5c 100644
+--- a/cmake-utils/utils.cmake
++++ b/cmake-utils/utils.cmake
+@@ -157,33 +157,6 @@ function(require_clang_version VERSION)
+     endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ endfunction(require_clang_version)
+ 
+-##################################################
+-# Find the location of a library and return its full path in OUTPUT_VARIABLE.
+-# If PATH_VARIABLE points to a defined variable, then the library will only be searched in this path.
+-# If PATH_VARIABLE points to a undefined variable, default system locations will be searched.
+-#
+-# Uses (the following will search for fuse in system locations by default, and if the user passes -DFUSE_LIB_PATH to cmake, it will only search in this path.
+-#  find_library_with_path(MYLIBRARY fuse FUSE_LIB_PATH)
+-#  target_link_library(target ${MYLIBRARY})
+-##################################################
+-function(find_library_with_path OUTPUT_VARIABLE LIBRARY_NAME PATH_VARIABLE)
+-    if(${PATH_VARIABLE})
+-        find_library(${OUTPUT_VARIABLE} ${LIBRARY_NAME} PATHS ${${PATH_VARIABLE}} NO_DEFAULT_PATH)
+-        if (${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-            message(FATAL_ERROR "Didn't find ${LIBRARY_NAME} in path specified by the ${PATH_VARIABLE} parameter (${${PATH_VARIABLE}}). Pass in the correct path or remove the parameter to try common system locations.")
+-        else(${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-            message(STATUS "Found ${LIBRARY_NAME} in user-defined path ${${PATH_VARIABLE}}")
+-        endif(${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-    else(${PATH_VARIABLE})
+-        find_library(${OUTPUT_VARIABLE} ${LIBRARY_NAME})
+-        if (${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-            message(FATAL_ERROR "Didn't find ${LIBRARY_NAME} library. If ${LIBRARY_NAME} is installed, try passing in the library location with -D${PATH_VARIABLE}=/path/to/${LIBRARY_NAME}/lib.")
+-        else(${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-            message(STATUS "Found ${LIBRARY_NAME} in system location")
+-        endif(${OUTPUT_VARIABLE} MATCHES NOTFOUND)
+-    endif(${PATH_VARIABLE})
+-endfunction(find_library_with_path)
+-
+ include(cmake-utils/TargetArch.cmake)
+ function(get_target_architecture output_var)
+ 	target_architecture(local_output_var)
+diff --git a/src/fspp/fuse/CMakeLists.txt b/src/fspp/fuse/CMakeLists.txt
+index b991bd72..8df3dbb7 100644
+--- a/src/fspp/fuse/CMakeLists.txt
++++ b/src/fspp/fuse/CMakeLists.txt
+@@ -35,12 +35,12 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+     DESTINATION "${CMAKE_INSTALL_BINDIR}"
+   )
+ 
+-elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+-  set(CMAKE_FIND_FRAMEWORK LAST)
+-  find_library_with_path(FUSE "osxfuse" FUSE_LIB_PATH)
+-  target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE})
+-else() # Linux
+-  find_library_with_path(FUSE "fuse" FUSE_LIB_PATH)
+-  target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE})
++else() # Linux and macOS
++  find_package(PkgConfig REQUIRED)
++  pkg_check_modules(Fuse REQUIRED IMPORTED_TARGET fuse)
++  target_link_libraries(${PROJECT_NAME} PUBLIC PkgConfig::Fuse)
+ endif()
+ 
++if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
++  set(CMAKE_FIND_FRAMEWORK LAST)
++endif()
+diff --git a/src/fspp/fuse/Fuse.cpp b/src/fspp/fuse/Fuse.cpp
+index 52cd5644..df0b400d 100644
+--- a/src/fspp/fuse/Fuse.cpp
++++ b/src/fspp/fuse/Fuse.cpp
+@@ -295,7 +295,7 @@ vector<char *> Fuse::_build_argv(const bf::path &mountdir, const vector<string>
+   // Make volume name default to mountdir on macOS
+   _add_fuse_option_if_not_exists(&argv, "volname", mountdir.filename().string());
+ #endif
+-  // TODO Also set read/write size for osxfuse. The options there are called differently.
++  // TODO Also set read/write size for macFUSE. The options there are called differently.
+   // large_read not necessary because reads are large anyhow. This option is only important for 2.4.
+   //argv.push_back(_create_c_string("-o"));
+   //argv.push_back(_create_c_string("large_read"));
+diff --git a/src/fspp/fuse/params.h b/src/fspp/fuse/params.h
+index 4a45ef79..9903ac82 100644
+--- a/src/fspp/fuse/params.h
++++ b/src/fspp/fuse/params.h
+@@ -3,14 +3,6 @@
+ #define MESSMER_FSPP_FUSE_PARAMS_H_
+ 
+ #define FUSE_USE_VERSION 26
+-#if defined(__linux__) || defined(__FreeBSD__)
+ #include <fuse.h>
+-#elif __APPLE__
+-#include <osxfuse/fuse.h>
+-#elif defined(_MSC_VER)
+-#include <fuse.h> // Dokany fuse
+-#else
+-#error System not supported
+-#endif
+ 
+ #endif
+diff --git a/src/fspp/impl/FilesystemImpl.cpp b/src/fspp/impl/FilesystemImpl.cpp
+index bc0ffbd7..23b28601 100644
+--- a/src/fspp/impl/FilesystemImpl.cpp
++++ b/src/fspp/impl/FilesystemImpl.cpp
+@@ -321,7 +321,7 @@ void FilesystemImpl::statfs(struct ::statvfs *fsstat) {
+   fsstat->f_namemax = stat.max_filename_length;
+ 
+   //f_frsize, f_favail, f_fsid and f_flag are ignored in fuse, see http://fuse.sourcearchive.com/documentation/2.7.0/structfuse__operations_4e765e29122e7b6b533dc99849a52655.html#4e765e29122e7b6b533dc99849a52655
+-  fsstat->f_frsize = fsstat->f_bsize; // even though this is supposed to be ignored, osxfuse needs it.
++  fsstat->f_frsize = fsstat->f_bsize; // even though this is supposed to be ignored, macFUSE needs it.
+ }
+ 
+ void FilesystemImpl::createSymlink(const bf::path &to, const bf::path &from, ::uid_t uid, ::gid_t gid) {
+diff --git a/test/fspp/testutils/FuseThread.cpp b/test/fspp/testutils/FuseThread.cpp
+index 277a2dac..7f3638db 100644
+--- a/test/fspp/testutils/FuseThread.cpp
++++ b/test/fspp/testutils/FuseThread.cpp
+@@ -23,7 +23,7 @@ void FuseThread::start(const bf::path &mountDir, const vector<string> &fuseOptio
+   //Wait until it is running (busy waiting is simple and doesn't hurt much here)
+   while(!_fuse->running()) {}
+ #ifdef __APPLE__
+-  // On Mac OS X, _fuse->running() returns true too early, because osxfuse calls init() when it's not ready yet. Give it a bit time.
++  // On Mac OS X, _fuse->running() returns true too early, because macFUSE calls init() when it's not ready yet. Give it a bit time.
+   std::this_thread::sleep_for(std::chrono::milliseconds(200));
+ #endif
+ }
diff --git a/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix
new file mode 100644
index 000000000000..8c8fe31624fe
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, autoreconfHook, fuse, curl, pkg-config, glib, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "curlftpfs";
+  version = "0.9.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/curlftpfs/curlftpfs-${version}.tar.gz";
+    sha256 = "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f";
+  };
+
+  patches = [
+    # This removes AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac because
+    # it is known to cause problems. Search online for "rpl_malloc" and
+    # "rpl_realloc" to find out more.
+    ./fix-rpl_malloc.patch
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ fuse curl glib zlib ];
+
+  CFLAGS = lib.optionalString stdenv.isDarwin "-D__off_t=off_t";
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # Fix the build on macOS with macFUSE installed. Needs autoreconfHook for
+    # this change to effect
+    substituteInPlace configure.ac --replace \
+      'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' \
+      ""
+  '';
+
+  doCheck = false; # fails, doesn't work well too, btw
+
+  meta = with lib; {
+    description = "Filesystem for accessing FTP hosts based on FUSE and libcurl";
+    homepage = "http://curlftpfs.sourceforge.net";
+    license = licenses.gpl2Only;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch b/nixpkgs/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch
new file mode 100644
index 000000000000..0265e1d82893
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch
@@ -0,0 +1,13 @@
+diff -Naur a/configure.ac b/configure.ac
+--- a/configure.ac	2008-04-23 20:37:42.000000000 +0900
++++ b/configure.ac	2021-05-16 01:28:24.000000000 +0900
+@@ -46,9 +46,7 @@
+ 
+ # Checks for library functions.
+ AC_FUNC_CHOWN
+-AC_FUNC_MALLOC
+ AC_FUNC_MKTIME
+-AC_FUNC_REALLOC
+ AC_FUNC_SELECT_ARGTYPES
+ AC_FUNC_STRFTIME
+ AC_FUNC_UTIME_NULL
diff --git a/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix b/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix
new file mode 100644
index 000000000000..54d23e770db1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fuse, zlib, bzip2, openssl, libxml2, icu, lzfse, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "darling-dmg";
+  version = "1.0.4+git20200427";
+
+  src = fetchFromGitHub {
+    owner = "darlinghq";
+    repo = "darling-dmg";
+    rev = "71cc76c792db30328663272788c0b64aca27fdb0";
+    sha256 = "08iphkxlmjddrxpbm13gxyqwcrd0k65z3l1944n4pccb6qbyj8gv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fuse openssl zlib bzip2 libxml2 icu lzfse ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  CXXFLAGS = [
+    "-DCOMPILE_WITH_LZFSE=1"
+    "-llzfse"
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.darlinghq.org/";
+    description = "Darling lets you open macOS dmgs on Linux";
+    platforms = platforms.unix;
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ Luflosi ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/0001-umount_davfs-substitute-ps-command.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/0001-umount_davfs-substitute-ps-command.patch
new file mode 100644
index 000000000000..3fbbc4c7d0fd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/davfs2/0001-umount_davfs-substitute-ps-command.patch
@@ -0,0 +1,25 @@
+From 0cb1321c4cbb2978318ddad73c9ee6f2a19c55c8 Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Sat, 11 Jan 2020 21:06:33 +0100
+Subject: [PATCH] umount_davfs: substitute ps command
+
+---
+ src/umount_davfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/umount_davfs.c b/src/umount_davfs.c
+index b7019c3..a278679 100644
+--- a/src/umount_davfs.c
++++ b/src/umount_davfs.c
+@@ -157,7 +157,7 @@ main(int argc, char *argv[])
+     }
+     fclose(file);
+ 
+-    char *ps_command = ne_concat("ps -p ", pid, NULL);
++    char *ps_command = ne_concat("@ps@ -p ", pid, NULL);
+     FILE *ps_in = popen(ps_command, "r");
+     if (!ps_in) {
+         error(0, 0,
+-- 
+2.24.1
+
diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch
new file mode 100644
index 000000000000..0e31725936fa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/davfs2/0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch
@@ -0,0 +1,42 @@
+From 56873cf29974ff0dfc1ba1afb7022ce49e300835 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Wed, 11 Nov 2020 11:58:25 +0100
+Subject: [PATCH 2/2] Make sure that the setuid-wrapped `umount` is invoked
+
+---
+ src/dav_fuse.c     | 2 +-
+ src/umount_davfs.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/dav_fuse.c b/src/dav_fuse.c
+index 734bc1f..4501433 100644
+--- a/src/dav_fuse.c
++++ b/src/dav_fuse.c
+@@ -187,7 +187,7 @@ dav_fuse_loop(int device, char *mpoint, size_t bufsize, time_t idle_time,
+             unmounting = 1;
+             pid_t pid = fork();
+             if (pid == 0) {
+-                execl("/bin/umount", "umount", "-il", mountpoint, NULL);
++                execl("@wrapperDir@/umount", "umount", "-il", mountpoint, NULL);
+                 _exit(EXIT_FAILURE);
+             }
+         }
+diff --git a/src/umount_davfs.c b/src/umount_davfs.c
+index b7019c3..75e3b4b 100644
+--- a/src/umount_davfs.c
++++ b/src/umount_davfs.c
+@@ -122,9 +122,9 @@ main(int argc, char *argv[])
+ 
+     char *umount_command = NULL;
+     if (mpoint) {
+-        umount_command = ne_concat("umount -i '", mpoint, "'", NULL);
++        umount_command = ne_concat("@wrapperDir@/umount -i '", mpoint, "'", NULL);
+     } else {
+-        umount_command = ne_concat("umount -i '", argv[optind], "'", NULL);
++        umount_command = ne_concat("@wrapperDir@/umount -i '", argv[optind], "'", NULL);
+         error(0, 0,
+               _("\n"
+                 "  can't evaluate PID file name;\n"
+-- 
+2.28.0
+
diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix b/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix
new file mode 100644
index 000000000000..7652cc978785
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, neon
+, procps
+, substituteAll
+, zlib
+, wrapperDir ? "/run/wrappers/bin"
+}:
+
+stdenv.mkDerivation rec {
+  name = "davfs2-1.6.0";
+
+  src = fetchurl {
+    url = "mirror://savannah/davfs2/${name}.tar.gz";
+    sha256 = "sha256-LmtnVoW9kXdyvmDwmZrgmMgPef8g3BMej+xFR8u2O1A=";
+  };
+
+  buildInputs = [ neon zlib ];
+
+  patches = [
+    ./fix-sysconfdir.patch
+    (substituteAll {
+      src = ./0001-umount_davfs-substitute-ps-command.patch;
+      ps = "${procps}/bin/ps";
+    })
+    (substituteAll {
+      src = ./0002-Make-sure-that-the-setuid-wrapped-umount-is-invoked.patch;
+      inherit wrapperDir;
+    })
+  ];
+
+  configureFlags = [ "--sysconfdir=/etc" ];
+
+  makeFlags = [
+    "sbindir=$(out)/sbin"
+    "ssbindir=$(out)/sbin"
+  ];
+
+  meta = {
+    homepage = "https://savannah.nongnu.org/projects/davfs2";
+    description = "Mount WebDAV shares like a typical filesystem";
+    license = lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      Web Distributed Authoring and Versioning (WebDAV), an extension to
+      the HTTP-protocol, allows authoring of resources on a remote web
+      server. davfs2 provides the ability to access such resources like
+      a typical filesystem, allowing for use by standard applications
+      with no built-in support for WebDAV.
+    '';
+
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch
new file mode 100644
index 000000000000..f71248a28f4d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch
@@ -0,0 +1,60 @@
+diff -ubr davfs2-1.4.7-orig/etc/Makefile.am davfs2-1.4.7/etc/Makefile.am
+--- davfs2-1.4.7-orig/etc/Makefile.am	2013-02-21 11:45:00.185763558 +0100
++++ davfs2-1.4.7/etc/Makefile.am	2013-02-21 11:53:05.423197775 +0100
+@@ -24,17 +24,17 @@
+ 
+ install-data-local: $(dist_pkgdata_DATA)
+ 	@$(NORMAL_INSTALL)
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+-	$(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf
+-	$(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private
+-	chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)
++	$(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf
++	$(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private
++	chmod 700 $(out)$(pkgsysconfdir)/certs/private
+ 
+ uninstall-local:
+ 	@$(NORMAL_UNINSTALL)
+ 	@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ 	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+-	  echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \
+-	  rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \
++	  echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \
++	  rm -f $(out)$(pkgsysconfdir)/$$f; \
+ 	done
+diff -ubr davfs2-1.4.7-orig/etc/Makefile.in davfs2-1.4.7/etc/Makefile.in
+--- davfs2-1.4.7-orig/etc/Makefile.in	2013-02-21 11:45:00.185763558 +0100
++++ davfs2-1.4.7/etc/Makefile.in	2013-02-21 11:53:27.241207128 +0100
+@@ -408,19 +408,19 @@
+ 
+ install-data-local: $(dist_pkgdata_DATA)
+ 	@$(NORMAL_INSTALL)
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+-	$(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf
+-	$(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private
+-	chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)
++	$(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf
++	$(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private
++	chmod 700 $(out)$(pkgsysconfdir)/certs/private
+ 
+ uninstall-local:
+ 	@$(NORMAL_UNINSTALL)
+ 	@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ 	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+-	  echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \
+-	  rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \
++	  echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \
++	  rm -f $(out)$(pkgsysconfdir)/$$f; \
+ 	done
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch
new file mode 100644
index 000000000000..ae69b4460f5a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch
@@ -0,0 +1,30 @@
+diff -ur davfs2-1.4.5-old/src/dav_coda.c davfs2-1.4.5-new/src/dav_coda.c
+--- davfs2-1.4.5-old/src/dav_coda.c	2009-06-04 20:30:32.000000000 +0200
++++ davfs2-1.4.5-new/src/dav_coda.c	2011-02-09 19:51:22.260530572 +0100
+@@ -52,6 +52,10 @@
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
++
+ 
+ #include "defaults.h"
+ #include "mount_davfs.h"
+diff -ur davfs2-1.4.5-old/src/dav_fuse.c davfs2-1.4.5-new/src/dav_fuse.c
+--- davfs2-1.4.5-old/src/dav_fuse.c	2009-06-30 20:06:44.000000000 +0200
++++ davfs2-1.4.5-new/src/dav_fuse.c	2011-02-09 19:52:23.938220524 +0100
+@@ -41,6 +41,12 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
+ 
+ #include "defaults.h"
+ #include "mount_davfs.h"
diff --git a/nixpkgs/pkgs/tools/filesystems/dduper/default.nix b/nixpkgs/pkgs/tools/filesystems/dduper/default.nix
new file mode 100644
index 000000000000..5d91e8d0dcc6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/dduper/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchpatch, fetchFromGitHub, btrfs-progs, python3 }:
+
+let
+  btrfsProgsPatched = btrfs-progs.overrideAttrs (oldAttrs: {
+    patches = [
+      (fetchpatch {
+        name = "0001-Print-csum-for-a-given-file-on-stdout.patch";
+        url = "https://raw.githubusercontent.com/Lakshmipathi/dduper/8fab08e0f1901bf54411d25f1767b48c978074cb/patch/btrfs-progs-v5.9/0001-Print-csum-for-a-given-file-on-stdout.patch";
+        sha256 = "1li9lslrap70ibad8sij3bgpxn5lqs0j10l60bmy3c36y866q3g1";
+      })
+    ];
+  });
+  py3 = python3.withPackages (ps: with ps; [
+    prettytable
+    numpy
+  ]);
+in
+stdenv.mkDerivation rec {
+  pname = "dduper";
+  version = "0.04";
+
+  src = fetchFromGitHub {
+    owner = "lakshmipathi";
+    repo = "dduper";
+    rev = "v${version}";
+    sha256 = "09ncdawxkffldadqhfblqlkdl05q2qmywxyg6p61fv3dr2f2v5wm";
+  };
+
+  buildInputs = [
+    btrfsProgsPatched
+    py3
+  ];
+
+  patchPhase = ''
+    substituteInPlace ./dduper --replace "/usr/sbin/btrfs.static" "${btrfsProgsPatched}/bin/btrfs"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m755 ./dduper $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Fast block-level out-of-band BTRFS deduplication tool.";
+    homepage = "https://github.com/Lakshmipathi/dduper";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ thesola10 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix b/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix
new file mode 100644
index 000000000000..10559985f867
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, mbedtls
+, fuse
+}:
+
+
+stdenv.mkDerivation rec {
+  pname = "dislocker";
+  version = "0.7.3";
+
+  src = fetchFromGitHub {
+    owner = "aorimn";
+    repo = "dislocker";
+    rev = "v${version}";
+    sha256 = "1ak68s1v5dwh8y2dy5zjybmrh0pnqralmyqzis67y21m87g47h2k";
+  };
+
+  patches = [
+    # This patch
+    #   1. adds support for the latest FUSE on macOS
+    #   2. uses pkg-config to find libfuse instead of searching in predetermined
+    #      paths
+    #
+    # https://github.com/Aorimn/dislocker/pull/246
+    (fetchpatch {
+      url = "https://github.com/Aorimn/dislocker/commit/7744f87c75fcfeeb414d0957771042b10fb64e62.diff";
+      sha256 = "0bpyccbbfjsidsrd2q9qylb95nvi8g3glb3jss7xmhywj86bhzr5";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fuse mbedtls ];
+
+  meta = with lib; {
+    description = "Read BitLocker encrypted partitions in Linux";
+    homepage    = "https://github.com/aorimn/dislocker";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ elitak ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix b/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix
new file mode 100644
index 000000000000..27dc55fb9263
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse, attr, asciidoc }:
+
+stdenv.mkDerivation rec {
+  pname = "disorderfs";
+  version = "0.5.11";
+
+  src = fetchurl {
+    url = "http://http.debian.net/debian/pool/main/d/disorderfs/disorderfs_${version}.orig.tar.bz2";
+    sha256 = "sha256-KqAMKVUykCgVdNyjacZjpVXqVdeob76v0iOuSd4TNIY=";
+  };
+
+  nativeBuildInputs = [ pkg-config asciidoc ];
+
+  buildInputs = [ fuse attr ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "An overlay FUSE filesystem that introduces non-determinism into filesystem metadata";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/djmount/default.nix b/nixpkgs/pkgs/tools/filesystems/djmount/default.nix
new file mode 100644
index 000000000000..f5b0a0315dfc
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/djmount/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "djmount";
+  version = "0.71";
+  src = fetchurl {
+    url = "mirror://sourceforge/djmount/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0kqf0cy3h4cfiy5a2sigmisx0lvvsi1n0fbyb9ll5gacmy1b8nxa";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse];
+
+  meta = {
+    homepage = "http://djmount.sourceforge.net/";
+    description = "UPnP AV client, mounts as a Linux filesystem the media content of compatible UPnP AV devices";
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.jagajaga ];
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix b/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix
new file mode 100644
index 000000000000..14d054364fd9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "dosfstools";
+  version = "4.1";
+
+  src = fetchFromGitHub {
+    owner = "dosfstools";
+    repo = "dosfstools";
+    rev = "v${version}";
+    sha256 = "1a2zn1655d5f1m6jp9vpn3bp8yfxhcmxx3mx23ai9hmxiydiykr1";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ]
+    ++ lib.optional stdenv.isDarwin libiconv;
+
+  configureFlags = [ "--enable-compat-symlinks" ];
+
+  meta = {
+    description = "Utilities for creating and checking FAT and VFAT file systems";
+    homepage = "https://github.com/dosfstools/dosfstools";
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+    license = lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/duff/default.nix b/nixpkgs/pkgs/tools/filesystems/duff/default.nix
new file mode 100644
index 000000000000..f980c7613332
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/duff/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, gettext }:
+
+stdenv.mkDerivation {
+  pname = "duff";
+  # The last release (0.5.2) is more than 2 years old and lacks features like -D,
+  # limiting its usefulness. Upstream appears comatose if not dead.
+  version = "2014-07-03";
+
+  src = fetchFromGitHub {
+    sha256 = "1k2dx38pjzc5d624vw1cs5ipj9fprsm5vqv55agksc29m63lswnx";
+    rev = "f26d4837768b062a3f98fa075c791d9c8a0bb75c";
+    repo = "duff";
+    owner = "elmindreda";
+  };
+
+  nativeBuildInputs = [ autoreconfHook gettext ];
+
+  preAutoreconf = ''
+    # gettexttize rightly refuses to run non-interactively:
+    cp ${gettext}/bin/gettextize .
+    substituteInPlace gettextize \
+      --replace "read dummy" "echo '(Automatically acknowledged)' #"
+    ./gettextize
+    sed 's@po/Makefile.in\( .*\)po/Makefile.in@po/Makefile.in \1@' \
+      -i configure.ac
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Quickly find duplicate files";
+    longDescription = ''
+      Duff is a Unix command-line utility for quickly finding duplicates in
+      a given set of files.
+    '';
+    homepage = "https://duff.dreda.org/";
+    license = licenses.zlib;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix b/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix
new file mode 100644
index 000000000000..bbc346d46f71
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, libgcrypt
+, pkg-config, glib, linuxHeaders ? stdenv.cc.libc.linuxHeaders, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "duperemove";
+  version = "0.11.2";
+
+  src = fetchFromGitHub {
+    owner = "markfasheh";
+    repo = "duperemove";
+    rev = "v${version}";
+    sha256 = "1a87mka2sfzhbch2jip6wlvvs0glxq9lqwmyrp359d1rmwwmqiw9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libgcrypt glib linuxHeaders sqlite ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with lib; {
+    description = "A simple tool for finding duplicated extents and submitting them for deduplication";
+    homepage = "https://github.com/markfasheh/duperemove";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ bluescreen303 thoughtpolice ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix
new file mode 100644
index 000000000000..327ddbf8d6dd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix
@@ -0,0 +1,80 @@
+{ lib, stdenv, buildPackages, fetchurl, fetchpatch, pkg-config, libuuid, gettext, texinfo
+, shared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "e2fsprogs";
+  version = "1.46.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-958mtPZb3AWfyhLh7GowQMPOGlA/tw65Fb7nGQOBXNU=";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "info" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ pkg-config texinfo ];
+  buildInputs = [ libuuid gettext ];
+
+  # Only use glibc's __GNUC_PREREQ(X,Y) (checks if compiler is gcc version >= X.Y) when using glibc
+  patches = if stdenv.hostPlatform.libc == "glibc" then null
+    else [
+      (fetchpatch {
+      url = "https://raw.githubusercontent.com/void-linux/void-packages/9583597eb3e6e6b33f61dbc615d511ce030bc443/srcpkgs/e2fsprogs/patches/fix-glibcism.patch";
+      sha256 = "1gfcsr0i3q8q2f0lqza8na0iy4l4p3cbii51ds6zmj0y4hz2dwhb";
+      excludes = [ "lib/ext2fs/hashmap.h" ];
+      extraPrefix = "";
+      })
+    ];
+
+  postPatch = ''
+    # Remove six failing tests
+    # https://github.com/NixOS/nixpkgs/issues/65471
+    for test in m_image_mmp m_mmp m_mmp_bad_csum m_mmp_bad_magic t_mmp_1on t_mmp_2off; do
+        rm -r "tests/$test"
+    done
+  '';
+
+  configureFlags =
+    if stdenv.isLinux then [
+      # It seems that the e2fsprogs is one of the few packages that cannot be
+      # build with shared and static libs.
+      (if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs")
+      "--enable-symlink-install"
+      "--enable-relative-symlinks"
+      "--with-crond-dir=no"
+      # fsck, libblkid, libuuid and uuidd are in util-linux-ng (the "libuuid" dependency)
+      "--disable-fsck"
+      "--disable-libblkid"
+      "--disable-libuuid"
+      "--disable-uuidd"
+    ] else [
+      "--enable-libuuid --disable-e2initrd-helper"
+    ];
+
+  checkInputs = [ buildPackages.perl ];
+  doCheck = true;
+
+  postInstall = ''
+    # avoid cycle between outputs
+    if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then
+      mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/
+    fi
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://e2fsprogs.sourceforge.net/";
+    description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
+    license = with licenses; [
+      gpl2Plus
+      lgpl2Plus # lib/ext2fs, lib/e2p
+      bsd3      # lib/uuid
+      mit       # lib/et, lib/ss
+    ];
+    platforms = platforms.unix;
+    maintainers = [ maintainers.eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix b/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix
new file mode 100644
index 000000000000..d448b0f67b5f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, e2fsprogs }:
+
+stdenv.mkDerivation rec {
+  pname = "e2tools";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "e2tools";
+    repo = "e2tools";
+    rev = "6ee7c2d9015dce7b90c3388096602e307e3bd790";
+    sha256 = "0nlqynrhj6ww7bnfhhfcx6bawii8iyvhgp6vz60zbnpgd68ifcx7";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ e2fsprogs ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://e2tools.github.io/";
+    description = "Utilities to read/write/manipulate files in an ext2/ext3 filesystem";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.leenaars ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/encfs/default.nix b/nixpkgs/pkgs/tools/filesystems/encfs/default.nix
new file mode 100644
index 000000000000..14701a615c01
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/encfs/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, pkg-config, perl
+, gettext, fuse, openssl, tinyxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "encfs";
+  version = "1.9.5";
+
+  src = fetchFromGitHub {
+    sha256 = "099rjb02knr6yz7przlnyj62ic0ag5ncs7vvcc36ikyqrmpqsdch";
+    rev = "v${version}";
+    repo = "encfs";
+    owner = "vgough";
+  };
+
+  buildInputs = [ gettext fuse openssl tinyxml2 ];
+  nativeBuildInputs = [ cmake pkg-config perl ];
+
+  cmakeFlags =
+    [ "-DUSE_INTERNAL_TINYXML=OFF"
+      "-DBUILD_SHARED_LIBS=ON"
+      "-DINSTALL_LIBENCFS=ON"
+    ];
+
+  meta = with lib; {
+    description = "An encrypted filesystem in user-space via FUSE";
+    homepage = "https://vgough.github.io/encfs";
+    license = with licenses; [ gpl3Plus lgpl3Plus ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/exfat/default.nix b/nixpkgs/pkgs/tools/filesystems/exfat/default.nix
new file mode 100644
index 000000000000..488ae337a332
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/exfat/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "exfat";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "relan";
+    repo = "exfat";
+    rev = "v${version}";
+    sha256 = "1q29pcysv747y6dis07953dkax8k9x50b5gg99gpz6rr46xwgkgb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ fuse ];
+
+  meta = with lib; {
+    description = "Free exFAT file system implementation";
+    inherit (src.meta) homepage;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dywedir ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix b/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix
new file mode 100644
index 000000000000..9917bf8d965e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, fetchpatch, file, libuuid, e2fsprogs, zlib, bzip2 }:
+
+stdenv.mkDerivation rec {
+  version = "0.3.2";
+  pname = "ext4magic";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ext4magic/${pname}-${version}.tar.gz";
+    sha256 = "8d9c6a594f212aecf4eb5410d277caeaea3adc03d35378257dfd017ef20ea115";
+  };
+
+  patches = [
+    (fetchpatch {
+        url = "https://sourceforge.net/p/ext4magic/tickets/10/attachment/ext4magic-0.3.2-i_dir_acl.patch";
+        sha256 = "1accydd8kigid68yir2fbihm3r3x8ws3iyznp25snkx41w6y6x8c";
+    })
+    ./glibc-fix.patch
+  ];
+
+  buildInputs = [ file libuuid e2fsprogs zlib bzip2 ];
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Recover / undelete files from ext3 or ext4 partitions";
+    longDescription = ''
+      ext4magic can recover/undelete files from ext3 or ext4 partitions
+      by retrieving file-information from the filesystem journal.
+
+      If the information in the journal are sufficient, ext4magic can
+      recover the most file types, with original filename, owner and group,
+      file mode bits and also the old atime/mtime stamps.
+
+      It's much more effective and works much better than extundelete.
+    '';
+    homepage = "http://ext4magic.sourceforge.net/ext4magic_en.html";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.rkoe ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ext4magic/glibc-fix.patch b/nixpkgs/pkgs/tools/filesystems/ext4magic/glibc-fix.patch
new file mode 100644
index 000000000000..906609788939
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ext4magic/glibc-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/src/recover.c b/src/recover.c
+index 41b4aee..30b5d8f 100644
+--- a/src/recover.c
++++ b/src/recover.c
+@@ -24,6 +24,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <utime.h>
++#include <sys/sysmacros.h>
+ 
+ #ifndef O_LARGEFILE
+ #define O_LARGEFILE 0
diff --git a/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix b/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix
new file mode 100644
index 000000000000..5992fd6a78e4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, e2fsprogs }:
+
+stdenv.mkDerivation {
+  version = "0.2.4";
+  pname = "extundelete";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/extundelete/extundelete-0.2.4.tar.bz2";
+    sha256 = "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1";
+  };
+
+  buildInputs = [ e2fsprogs ];
+
+  # inode field i_dir_acl was repurposed as i_size_high in e2fsprogs 1.44,
+  # breaking the build
+  patchPhase = ''
+    substituteInPlace src/insertionops.cc \
+      --replace "Directory ACL:" "High 32 bits of size:" \
+      --replace "inode.i_dir_acl" "inode.i_size_high"
+  '';
+
+  meta = with lib; {
+    description = "Utility that can recover deleted files from an ext3 or ext4 partition";
+    homepage = "http://extundelete.sourceforge.net/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.domenkozar ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix
new file mode 100644
index 000000000000..4b3d5c9ac1ef
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchgit, autoreconfHook, libselinux, libuuid, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "f2fs-tools";
+  version = "1.14.0";
+
+  src = fetchgit {
+    url = "https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "06ss05n87i1c3149qb3n7j1qp2scv3g2adx0v6ljkl59ab9b5saj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libselinux libuuid ];
+
+  patches = [ ./f2fs-tools-cross-fix.patch ];
+
+  meta = with lib; {
+    homepage = "http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/";
+    description = "Userland tools for the f2fs filesystem";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ehmry jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch
new file mode 100644
index 000000000000..e01a97b0bc3c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch
@@ -0,0 +1,29 @@
+diff --git a/configure.ac b/configure.ac
+index 9b0e872..0108219 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,14 +20,16 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpatsubst(f2fs_tools_version,
+ 				[\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]),
+ 				[Minor version for f2fs-tools])
+ 
+-AS_IF([test -d .git],[
+-	AC_DEFINE([F2FS_TOOLS_DATE],
+-		"m4_bpatsubst(f2fs_tools_gitdate,
+-		[\([0-9-]*\)\(\w\|\W\)*], [\1])",
+-		[f2fs-tools date based on Git commits])],[
+-	AC_DEFINE([F2FS_TOOLS_DATE],
+-		"f2fs_tools_date",
+-		[f2fs-tools date based on Source releases])])
++dnl AS_IF([test -d .git],[
++dnl	AC_DEFINE([F2FS_TOOLS_DATE],
++dnl		"m4_bpatsubst(f2fs_tools_gitdate,
++dnl		[\([0-9-]*\)\(\w\|\W\)*], [\1])",
++dnl		[f2fs-tools date based on Git commits])],[
++dnl	AC_DEFINE([F2FS_TOOLS_DATE],
++dnl		"f2fs_tools_date",
++dnl		[f2fs-tools date based on Source releases])])
++
++AC_DEFINE([F2FS_TOOLS_DATE], "f2fs_tools_date", [f2fs-tools date based on Source releases])
+ 
+ AC_CONFIG_SRCDIR([config.h.in])
+ AC_CONFIG_HEADER([config.h])
diff --git a/nixpkgs/pkgs/tools/filesystems/f3/default.nix b/nixpkgs/pkgs/tools/filesystems/f3/default.nix
new file mode 100644
index 000000000000..b9817ecb05c0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/f3/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, fetchFromGitHub
+, parted, systemd ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "f3";
+  version = "8.0";
+
+  src = fetchFromGitHub {
+    owner = "AltraMayor";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "17l5vspfcgfbkqg7bakp3gql29yb05gzawm8n3im30ilzdr53678";
+  };
+
+  postPatch = ''
+     sed -i 's/-oroot -groot//' Makefile
+
+     for f in f3write.h2w log-f3wr; do
+      substituteInPlace $f \
+        --replace '$(dirname $0)' $out/bin
+     done
+  '';
+
+  buildInputs = [
+    parted
+  ]
+  ++ lib.optional stdenv.isLinux systemd;
+
+  enableParallelBuilding = true;
+
+  buildFlags   = [
+    "all" # f3read, f3write
+  ]
+  ++ lib.optional stdenv.isLinux "extra"; # f3brew, f3fix, f3probe
+
+  installFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  installTargets = [
+    "install"
+  ]
+  ++ lib.optional stdenv.isLinux "install-extra";
+
+  postInstall = ''
+    install -Dm555 -t $out/bin f3write.h2w log-f3wr
+    install -Dm444 -t $out/share/doc/${pname} LICENSE README.rst
+  '';
+
+  meta = with lib; {
+    description = "Fight Flash Fraud";
+    homepage = "http://oss.digirati.com.br/f3/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix b/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix
new file mode 100644
index 000000000000..8f258a79f7de
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, parted, util-linux, pkg-config }:
+
+stdenv.mkDerivation rec {
+
+  version = "1.1.0";
+  pname = "fatresize";
+
+  src = fetchFromGitHub {
+    owner = "ya-mouse";
+    repo = "fatresize";
+    rev = "v${version}";
+    sha256 = "1vhz84kxfyl0q7mkqn68nvzzly0a4xgzv76m6db0bk7xyczv1qr2";
+  };
+
+  buildInputs = [ parted util-linux ];
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ parted util-linux ];
+
+  meta = with lib; {
+    description = "The FAT16/FAT32 non-destructive resizer";
+    homepage = "https://github.com/ya-mouse/fatresize";
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix b/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix
new file mode 100644
index 000000000000..ec7563dfc494
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix
@@ -0,0 +1,26 @@
+{lib, stdenv, fetchurl, help2man}:
+
+stdenv.mkDerivation rec {
+  version = "1.6.3.622";
+  pname = "fatsort";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/fatsort/${pname}-${version}.tar.xz";
+    sha256 = "1z2nabm38lg56h05yx3jjsndbqxk1zbjcisrczzamypn13m98728";
+  };
+
+  patches = [ ./fatsort-Makefiles.patch ];
+
+  buildInputs = [ help2man ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with lib; {
+    homepage = "http://fatsort.sourceforge.net/";
+    description = "Sorts FAT partition table, for devices that don't do sorting of files";
+    maintainers = [ maintainers.kovirobi ];
+    license = licenses.gpl2;
+    inherit version;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch b/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
new file mode 100644
index 000000000000..51775edfb41d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch
@@ -0,0 +1,34 @@
+diff -uNr fatsort-1.6.2.605.orig/Makefile fatsort-1.6.2.605.new/Makefile
+--- fatsort-1.6.2.605.orig/Makefile	2019-11-16 16:40:27.000000000 +0100
++++ fatsort-1.6.2.605.new/Makefile	2020-05-10 21:34:34.820874026 +0200
+@@ -1,4 +1,5 @@
+-MANDIR=/usr/local/share/man/man1
++PREFIX?=/usr/local
++MANDIR=$(PREFIX)/share/man/man1
+ 
+ INSTALL_FLAGS=-m 0755 -p -D
+ 
+diff -uNr fatsort-1.6.2.605.orig/src/Makefile fatsort-1.6.2.605.new/src/Makefile
+--- fatsort-1.6.2.605.orig/src/Makefile	2018-11-17 00:40:59.000000000 +0100
++++ fatsort-1.6.2.605.new/src/Makefile	2020-05-10 21:33:52.053391027 +0200
+@@ -30,7 +30,7 @@
+ 		override CFLAGS += -D __CYGWIN__
+ 		override CFLAGS += -D __LINUX__
+ 		override LDFLAGS += -liconv
+-		SBINDIR=/usr/local/sbin
++		SBINDIR=$(PREFIX)/sbin
+ 	endif
+ else
+ 	ifdef MINGW
+@@ -60,9 +60,9 @@
+ 			# OS X's install does not support the '-D' flag.
+ 			INSTALL_FLAGS=-m 0755 -p
+ 			# Mac OS X does not have a "/usr/local/sbin"
+-			SBINDIR=/usr/local/bin
++			SBINDIR=$(PREFIX)/bin
+ 		else
+-			SBINDIR=/usr/local/sbin
++			SBINDIR=$(PREFIX)/sbin
+ 		endif
+ 	endif
+ endif
diff --git a/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix b/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix
new file mode 100644
index 000000000000..133f446f8a98
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, perl, perlPackages }:
+
+perlPackages.buildPerlPackage {
+  pname = "File-Rename";
+  version = "0.20";
+
+  src = fetchurl {
+    url = "mirror://cpan/authors/id/R/RM/RMBARKER/File-Rename-0.20.tar.gz";
+    sha256 = "1cf6xx2hiy1xalp35fh8g73j67r0w0g66jpcbc6971x9jbm7bvjy";
+  };
+
+  # Fix an incorrect platform test that misidentifies Darwin as Windows
+  postPatch = ''
+    substituteInPlace Makefile.PL \
+      --replace '/win/i' '/MSWin32/'
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/bin/rename \
+      --replace "#!${perl}/bin/perl" "#!${perl}/bin/perl -I $out/${perl.libPrefix}"
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "Perl extension for renaming multiple files";
+    license = licenses.artistic1;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix b/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix
new file mode 100644
index 000000000000..114c83e84f4a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, openssl, fuse}:
+
+throw "It still does not build"
+
+stdenv.mkDerivation {
+  name = "fsfs-0.1.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/fsfs/fsfs-0.1.1.tar.gz";
+    sha256 = "05wka9aq182li2r7gxcd8bb3rhpns7ads0k59v7w1jza60l57c74";
+  };
+
+  buildInputs = [ fuse openssl ];
+
+  patchPhase = ''
+    sed -i -e 's,CONFDIR=\(.*\),CONFDIR='$out/etc, \
+      -e 's,USERCONFPREFIX=\(.*\),USERCONFPREFIX='$out/var/lib, Makefile \
+      src/Makefile src/utils/Makefile
+  '';
+
+  preInstall = ''
+    mkdir -p $out/etc $out/var/lib
+    makeFlags="$makeFlags prefix=$out"
+  '';
+
+  meta = {
+    homepage = "http://fsfs.sourceforge.net/";
+    description = "Secure distributed file system in user space";
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix
new file mode 100644
index 000000000000..8a0671957c35
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, fuse, p7zip, autoconf, automake, pkg-config, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "fuse-7z-ng";
+  version = "git-2014-06-08";
+
+  src = fetchFromGitHub {
+    owner = "kedazo";
+    repo = pname;
+    rev = "eb5efb1f304c2b7bc2e0389ba06c9bf2ac4b932c";
+    sha256 = "17v1gcmg5q661b047zxjar735i4d3508dimw1x3z1pk4d1zjhp3x";
+  };
+
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+  buildInputs = [ fuse autoconf automake ];
+
+  preConfigure = "./autogen.sh";
+
+  libs = lib.makeLibraryPath [ p7zip ]; # 'cause 7z.so is loaded manually
+  postInstall = ''
+    wrapProgram $out/bin/${pname} --suffix LD_LIBRARY_PATH : "${libs}/p7zip"
+
+    mkdir -p $out/share/doc/${pname}
+    cp TODO README NEWS COPYING ChangeLog AUTHORS $out/share/doc/${pname}/
+  '';
+
+  meta = with lib; {
+    inherit version;
+    inherit (src.homepage);
+    description = "A FUSE-based filesystem that uses the p7zip library";
+    longDescription = ''
+      fuse-7z-ng is a FUSE file system that uses the p7zip
+      library to access all archive formats supported by 7-zip.
+
+      This project is a fork of fuse-7z ( https://gitorious.org/fuse-7z/fuse-7z ).
+    '';
+    platforms = platforms.linux;
+    license = licenses.gpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix b/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix
new file mode 100644
index 000000000000..3631e52d87d1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, fuse3, nixosTests }:
+
+stdenv.mkDerivation rec {
+  pname = "fuse-overlayfs";
+  version = "1.5.0";
+
+  src = fetchFromGitHub {
+    owner = "containers";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-/gdmrQhYsE4a/1sxtJ5IfVUWjh08wTVrOr4V7Fkn1i0=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ fuse3 ];
+
+  passthru.tests = { inherit (nixosTests) podman; };
+
+  meta = with lib; {
+    description = "FUSE implementation for overlayfs";
+    longDescription = "An implementation of overlay+shiftfs in FUSE for rootless containers.";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ma9e ] ++ teams.podman.members;
+    platforms = platforms.linux;
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix b/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix
new file mode 100644
index 000000000000..7e44e7c15f9c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, fuse, glib, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "fuseiso";
+  version = "20070708";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/fuseiso/fuseiso/${version}/fuseiso-${version}.tar.bz2";
+    sha256 = "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "00-support_large_iso.patch";
+      url = "https://sources.debian.net/data/main/f/fuseiso/${version}-3.2/debian/patches/00-support_large_iso.patch";
+      sha256 = "1lmclb1qwzz5f4wlq693g83bblwnjjl73qhgfxbsaac5hnn2shjw";
+    })
+    (fetchpatch {
+      name = "01-fix_typo.patch";
+      url = "https://sources.debian.net/data/main/f/fuseiso/${version}-3.2/debian/patches/01-fix_typo.patch";
+      sha256 = "14rpxp0yylzsgqv0r19l4wx1h5hvqp617gpv1yg0w48amr9drasa";
+    })
+    (fetchpatch {
+      name = "02-prevent-buffer-overflow_CVE-2015-8837.patch";
+      url = "https://sources.debian.net/data/main/f/fuseiso/${version}-3.2/debian/patches/02-prevent-buffer-overflow.patch";
+      sha256 = "1ls2pp3mh91pdb51qz1fsd8pwhbky6988bpd156bn7wgfxqzh8ig";
+    })
+    (fetchpatch {
+      name = "03-prevent-integer-overflow_CVE-2015-8836.patch";
+      url = "https://sources.debian.net/data/main/f/fuseiso/${version}-3.2/debian/patches/03-prevent-integer-overflow.patch";
+      sha256 = "100cw07fk4sa3hl7a1gk2hgz4qsxdw99y20r7wpidwwwzy463zcv";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ fuse glib zlib ];
+
+  # after autoreconfHook, glib and zlib are not found, so force link against
+  # them
+  NIX_LDFLAGS = "-lglib-2.0 -lz";
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    install -Dm444 -t $out/share/doc/${pname} NEWS README
+  '';
+
+  meta = with lib; {
+    description = "FUSE module to mount ISO filesystem images";
+    homepage = "https://sourceforge.net/projects/fuseiso";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/fwanalyzer/default.nix b/nixpkgs/pkgs/tools/filesystems/fwanalyzer/default.nix
new file mode 100644
index 000000000000..002668173902
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/fwanalyzer/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, e2tools
+, makeWrapper
+, mtools
+}:
+
+buildGoModule rec {
+  pname = "fwanalyzer";
+  version = "1.4.3";
+
+  src = fetchFromGitHub {
+    owner = "cruise-automation";
+    repo = pname;
+    rev = version;
+    sha256 = "1pj6s7lzw7490488a30pzvqy2riprfnhb4nzxm6sh2nsp51xalzv";
+  };
+
+  vendorSha256 = "1cjbqx75cspnkx7fgc665q920dsxnsdhqgyiawkvx0i8akczbflw";
+
+  subPackages = [ "cmd/${pname}" ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/fwanalyzer" --prefix PATH : "${lib.makeBinPath [ e2tools mtools ]}"
+  '';
+
+  # The tests requires an additional setup (unpacking images, etc.)
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Tool to analyze filesystem images";
+    homepage = "https://github.com/cruise-automation/fwanalyzer";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix
new file mode 100644
index 000000000000..ee7f86760707
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  pname = "gcsfuse";
+  version = "0.35.0";
+
+  src = fetchFromGitHub {
+    owner = "googlecloudplatform";
+    repo = "gcsfuse";
+    rev = "v${version}";
+    sha256 = "sha256-GJ21Cqd/W/PocmN1p4OeeUdswhH7fSmAMiNTs0X3564=";
+  };
+
+  goPackagePath = "github.com/googlecloudplatform/gcsfuse";
+
+  subPackages = [ "." "tools/mount_gcsfuse" ];
+
+  postInstall = ''
+    ln -s $out/bin/mount_gcsfuse $out/bin/mount.gcsfuse
+    ln -s $out/bin/mount_gcsfuse $out/bin/mount.fuse.gcsfuse
+  '';
+
+  buildFlagsArray = [ "-ldflags=-s -w -X main.gcsfuseVersion=${version}" ];
+
+  meta = with lib;{
+    description = "A user-space file system for interacting with Google Cloud Storage";
+    homepage = "https://cloud.google.com/storage/docs/gcs-fuse";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = [];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix b/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix
new file mode 100644
index 000000000000..ccc048f75723
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "genext2fs-1.4.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/genext2fs/genext2fs-1.4.1.tar.gz";
+    sha256 = "1z7czvsf3ircvz2cw1cf53yifsq29ljxmj15hbgc79l6gbxbnka0";
+  };
+
+  # https://sourceforge.net/p/genext2fs/bugs/2/
+  # Will be fixed in the next release, whenever this happens
+  postPatch = ''
+    sed -e 's@4 [*] (EXT2_TIND_BLOCK+1)@-1+&@' -i genext2fs.c
+  '';
+
+  meta = with lib; {
+    homepage = "http://genext2fs.sourceforge.net/";
+    description = "A tool to generate ext2 filesystem images without requiring root privileges";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/genimage/default.nix b/nixpkgs/pkgs/tools/filesystems/genimage/default.nix
new file mode 100644
index 000000000000..b3ca1ae8394b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/genimage/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, libconfuse, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "genimage";
+  version = "9";
+
+  src = fetchurl {
+    url = "https://public.pengutronix.de/software/genimage/genimage-${version}.tar.xz";
+    sha256 = "0y4h8x8lqxam8m90rdfq8cg5137kvilxr3d1qzddpx7nxpvmmwv9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libconfuse gettext ];
+
+  postInstall = ''
+    # As there is no manpage or built-in --help, add the README file for
+    # documentation.
+    docdir="$out/share/doc/genimage"
+    mkdir -p "$docdir"
+    cp -v README "$docdir"
+  '';
+
+  meta = with lib; {
+    homepage = "https://git.pengutronix.de/cgit/genimage";
+    description = "Generate filesystem images from directory trees";
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix b/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix
new file mode 100644
index 000000000000..205d84791ec9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "0.5.2";
+  pname = "genromfs";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/romfs/genromfs/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0q6rpq7cmclmb4ayfyknvzbqysxs4fy8aiahlax1sb2p6k3pzwrh";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "prefix = /usr" "prefix = $out" \
+      --replace "gcc" "cc"
+  '';
+
+  meta = with lib; {
+    homepage = "http://romfs.sourceforge.net/";
+    description = "Tool for creating romfs file system images";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix b/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix
new file mode 100644
index 000000000000..03e76e5fb275
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix
@@ -0,0 +1,43 @@
+{ lib, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "gitfs";
+  version = "0.5.2";
+
+  src = fetchFromGitHub {
+    owner = "PressLabs";
+    repo = "gitfs";
+    rev = version;
+    sha256 = "1jzwdwan8ndvp2lw6j7zbvg5k9rgf2d8dcxjrwc6bwyk59xdxn4p";
+  };
+
+  patchPhase = ''
+    # requirement checks are unnecessary at runtime
+    echo > requirements.txt
+
+    # NOTE: As of gitfs 0.5.2, The pygit2 release that upstream uses is a major
+    # version behind the one packaged in nixpkgs.
+    substituteInPlace gitfs/mounter.py --replace \
+      'from pygit2.remote import RemoteCallbacks' \
+      'from pygit2 import RemoteCallbacks'
+  '';
+
+  checkInputs = with python3Packages; [ pytest pytestcov mock ];
+  propagatedBuildInputs = with python3Packages; [ atomiclong fusepy pygit2 six ];
+
+  checkPhase = "py.test";
+  doCheck = false;
+
+  meta = {
+    description = "A FUSE filesystem that fully integrates with git";
+    longDescription = ''
+      A git remote repository's branch can be mounted locally,
+      and any subsequent changes made to the files will be
+      automatically committed to the remote.
+    '';
+    homepage = "https://github.com/PressLabs/gitfs";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.robbinch ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix b/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix
new file mode 100644
index 000000000000..d7906e5cc23b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix
@@ -0,0 +1,191 @@
+{lib, stdenv, fetchFromGitHub, fuse, bison, flex_2_5_35, openssl, python3, ncurses, readline,
+ autoconf, automake, libtool, pkg-config, zlib, libaio, libxml2, acl, sqlite,
+ liburcu, liburing, attr, makeWrapper, coreutils, gnused, gnugrep, which,
+ openssh, gawk, findutils, util-linux, lvm2, btrfs-progs, e2fsprogs, xfsprogs, systemd,
+ rsync, glibc, rpcsvc-proto, libtirpc
+}:
+let
+  # NOTE: On each glusterfs release, it should be checked if gluster added
+  #       new, or changed, Python scripts whose PYTHONPATH has to be set in
+  #       `postFixup` below, and whose runtime deps need to go into
+  #       `nativeBuildInputs`.
+  #       The command
+  #         find /nix/store/...-glusterfs-.../ -name '*.py' -executable
+  #       can help with finding new Python scripts.
+
+  buildInputs = [
+    fuse bison flex_2_5_35 openssl ncurses readline
+    autoconf automake libtool pkg-config zlib libaio libxml2
+    acl sqlite liburcu attr makeWrapper util-linux libtirpc
+    liburing
+    (python3.withPackages (pkgs: [
+      pkgs.flask
+      pkgs.prettytable
+      pkgs.requests
+      pkgs.pyxattr
+    ]))
+    # NOTE: `python3` has to be *AFTER* the above `python3.withPackages`,
+    #       to ensure that the packages are available but the `toPythonPath`
+    #       shell function used in `postFixup` is also still available.
+    python3
+  ];
+  # Some of the headers reference acl
+  propagatedBuildInputs = [
+    acl
+  ];
+  # Packages from which GlusterFS calls binaries at run-time from PATH,
+  # with comments on which commands are known to be called by it.
+  runtimePATHdeps = [
+    attr # getfattr setfattr
+    btrfs-progs # btrfs
+    coreutils # lots of commands in bash scripts
+    e2fsprogs # tune2fs
+    findutils # find
+    gawk # awk
+    glibc # getent
+    gnugrep # grep
+    gnused # sed
+    lvm2 # lvs
+    openssh # ssh
+    rsync # rsync, e.g. for geo-replication
+    systemd # systemctl
+    util-linux # mount umount
+    which # which
+    xfsprogs # xfs_info
+  ];
+in stdenv.mkDerivation rec {
+  pname = "glusterfs";
+  version = "9.2";
+
+  src = fetchFromGitHub {
+    owner = "gluster";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "00y2xs7nj4d59x4fp6gq7qql3scykq9lppdvx7y3xbgfmkrwixx9";
+  };
+  inherit buildInputs propagatedBuildInputs;
+
+  postPatch = ''
+    sed -e '/chmod u+s/d' -i contrib/fuse-util/Makefile.am
+    substituteInPlace libglusterfs/src/glusterfs/lvm-defaults.h \
+      --replace '/sbin/' '${lvm2}/bin/'
+    substituteInPlace libglusterfs/src/glusterfs/compat.h \
+      --replace '/bin/umount' '${util-linux}/bin/umount'
+    substituteInPlace contrib/fuse-lib/mount-gluster-compat.h \
+      --replace '/bin/mount' '${util-linux}/bin/mount'
+  '';
+
+  # Note that the VERSION file is something that is present in release tarballs
+  # but not in git tags (at least not as of writing in v3.10.1).
+  # That's why we have to create it.
+  # Without this, gluster (at least 3.10.1) will fail very late and cryptically,
+  # for example when setting up geo-replication, with a message like
+  #   Staging of operation 'Volume Geo-replication Create' failed on localhost : Unable to fetch master volume details. Please check the master cluster and master volume.
+  # What happens here is that the gverify.sh script tries to compare the versions,
+  # but fails when the version is empty.
+  # See upstream GlusterFS bug https://bugzilla.redhat.com/show_bug.cgi?id=1452705
+  preConfigure = ''
+    echo "v${version}" > VERSION
+    ./autogen.sh
+    export PYTHON=${python3}/bin/python
+    '';
+
+  configureFlags = [
+    "--localstatedir=/var"
+    ];
+
+  nativeBuildInputs = [ rpcsvc-proto ];
+
+  makeFlags = [ "DESTDIR=$(out)" ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    cp -r $out/$out/* $out
+    rm -r $out/nix
+  '';
+
+  postFixup = ''
+    # glusterd invokes `gluster` and other utilities when telling other glusterd nodes to run commands.
+    # For example for `peer_georep-sshkey` key generation, so `$out/bin` is needed in the PATH.
+    # It also invokes bash scripts like `gverify.sh`.
+    # It also invokes executable Python scripts in `$out/libexec/glusterfs`, which is why we set up PYTHONPATH accordingly.
+    # We set up the paths for the main entry point executables.
+
+    GLUSTER_PATH="${lib.makeBinPath runtimePATHdeps}:$out/bin"
+    GLUSTER_PYTHONPATH="$(toPythonPath $out):$out/libexec/glusterfs"
+    GLUSTER_LD_LIBRARY_PATH="$out/lib"
+
+    wrapProgram $out/bin/glusterd --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/bin/gluster --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/sbin/mount.glusterfs --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+
+    # Set Python environment for the Python based utilities.
+    # It would be nice if there was a better way to do this, automatically for all of them.
+    # Also, this is brittle: If we forget a dependency or gluster adds a new one, things will break deep inside gluster.
+    # We should better try to get an explicit list of Python dependencies from gluster and ensure all of them are in the PYTHONPATH of all these python scripts.
+    # But at the time of writing (gluster 3.10), gluster only provides this in form of a gluster.spec file for RPM creation,
+    # and even that one is not complete (for example it doesn't mention the `flask` dependency).
+
+    wrapProgram $out/bin/gluster-eventsapi --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/bin/gluster-georep-sshkey --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/bin/gluster-mountbroker --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/bin/glusterfind --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+
+    # Note that we only wrap the symlinks in $out/bin, not the actual executable scripts in $out/libexec/glusterfs.
+    # This is because those scripts use `__file__` in their program logic
+    # (see https://github.com/gluster/glusterfs/blob/v3.10.1/extras/cliutils/cliutils.py#L116)
+    # which would break if we changed the file name (which is what `wrapProgram` does).
+    # Luckily, `libexec` scripts are never supposed to be invoked straight from PATH,
+    # instead they are invoked directly from `gluster` or `glusterd`, which is why it is
+    # sufficient to set PYTHONPATH for those executables.
+    #
+    # Exceptions to these rules are the `glusterfind` `brickfind.py` and `changelog.py`
+    # crawlers, which are directly invoked on other gluster nodes using a remote SSH command
+    # issues by `glusterfind`.
+
+    wrapProgram $out/share/glusterfs/scripts/eventsdash.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/libexec/glusterfs/glusterfind/brickfind.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+    wrapProgram $out/libexec/glusterfs/glusterfind/changelog.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH"
+  '';
+
+  doInstallCheck = true;
+
+  # Below we run Python programs. That generates .pyc/.pyo files.
+  # By default they are indeterministic because such files contain time stamps
+  # (see https://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html).
+  # So we use the same environment variables as in
+  #   https://github.com/NixOS/nixpkgs/blob/249b34aadca7038207492f29142a3456d0cecec3/pkgs/development/interpreters/python/mk-python-derivation.nix#L61
+  # to make these files deterministic.
+  # A general solution to this problem might be brought by #25707.
+  DETERMINISTIC_BUILD = 1;
+  PYTHONHASHSEED = 0;
+
+  installCheckPhase = ''
+    # Tests that the above programs work without import errors.
+    # For testing it manually in a shell you may want to substitute `$out` with `$(dirname $(readlink -f $(which gluster)))/../`.
+    $out/bin/glusterd --help
+    # $out/bin/gluster help # can't do this because even `gluster help` tries to write to `/var/log/glusterfs/cli.log`
+    $out/bin/gluster-eventsapi --help
+    $out/bin/gluster-georep-sshkey --help
+    $out/bin/gluster-mountbroker --help
+    $out/bin/glusterfind --help
+    # gfid_to_path.py doesn't accept --help, and it requires different arguments
+    # (a dir as single argument) than the usage prints when stdin is not a TTY.
+    # The `echo ""` is just so that stdin is not a TTY even if you try this line
+    # on a real TTY for testing purposes.
+    echo "" | (mkdir -p nix-test-dir-for-gfid_to_path && touch b && $out/libexec/glusterfs/gfind_missing_files/gfid_to_path.py nix-test-dir-for-gfid_to_path)
+    $out/share/glusterfs/scripts/eventsdash.py --help
+
+    # this gets falsely loaded as module by glusterfind
+    rm -r $out/bin/conf.py
+    '';
+
+  meta = with lib; {
+    description = "Distributed storage system";
+    homepage = "https://www.gluster.org";
+    license = licenses.lgpl3Plus; # dual licese: choice of lgpl3Plus or gpl2
+    maintainers = [ maintainers.raskin ];
+    platforms = with platforms; linux ++ freebsd;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix
new file mode 100644
index 000000000000..bd6e0fe67fc2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix
@@ -0,0 +1,20 @@
+{ pkg-config, libusb1, buildGoPackage, fetchgit }:
+
+buildGoPackage rec {
+  pname = "go-mtpfs";
+  version = "2018-02-09";
+  rev = "d6f8f3c05ce0ed31435057ec342268a0735863bb";
+
+  goPackagePath = "github.com/hanwen/go-mtpfs";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libusb1 ];
+
+  src = fetchgit {
+    inherit rev;
+    url = "https://github.com/hanwen/go-mtpfs";
+    sha256 = "0a0d5dy92nzp1czh87hx3xfdcpa4jh14j0b64c025ha62s9a4gxk";
+  };
+
+  goDeps = ./deps.nix;
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix
new file mode 100644
index 000000000000..f558a53f7d2d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix
@@ -0,0 +1,30 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
+[
+  {
+    goPackagePath = "github.com/hanwen/go-fuse";
+    fetch = {
+      type = "git";
+      url = "https://github.com/hanwen/go-fuse";
+      rev = "d1c826d19ad0c8d0c7e5b4eb34ee0f2ae09f6cef";
+      sha256 = "0hn2iqsb6rip2b05fvcngyh0sazln2h3fx18khq4fv41n1iy11dc";
+    };
+  }
+  {
+    goPackagePath = "github.com/hanwen/usb";
+    fetch = {
+      type = "git";
+      url = "https://github.com/hanwen/usb";
+      rev = "69aee4530ac705cec7c5344418d982aaf15cf0b1";
+      sha256 = "01k0c2g395j65vm1w37mmrfkg6nm900khjrrizzpmx8f8yf20dky";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev = "48ac38b7c8cbedd50b1613c0fccacfc7d88dfcdf";
+      sha256 = "037vs8sdvq310j3b6z9k62zlby1mzmsr9ha01rcy98dv5v8bkhin";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix b/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix
new file mode 100644
index 000000000000..c2e022ca4bde
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, buildGoModule
+, fetchFromGitHub
+, openssl
+, pandoc
+, pkg-config
+, libfido2
+}:
+
+let
+  # pandoc is currently broken on aarch64-darwin
+  # because of missing ghc
+  brokenPandoc = stdenv.isDarwin && stdenv.isAarch64;
+in
+
+buildGoModule rec {
+  pname = "gocryptfs";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "rfjakob";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0wiagmym8mwi0vpvrs5ryn3zjwha8ilh7xkavvkd1gqd5laln0kp";
+  };
+
+  vendorSha256 = "10az8n7z4rhsk1af2x6v3pmxg4zp7c9cal35ily8bdzzcb9cpgs0";
+
+  nativeBuildInputs = [
+    pkg-config
+  ] ++ lib.optionals (!brokenPandoc) [
+    pandoc
+  ];
+
+  buildInputs = [ openssl ];
+
+  propagatedBuildInputs = [ libfido2 ];
+
+  buildFlagsArray = ''
+    -ldflags=
+      -X main.GitVersion=${version}
+      -X main.GitVersionFuse=[vendored]
+      -X main.BuildDate=unknown
+  '';
+
+  subPackages = [ "." "gocryptfs-xray" "contrib/statfs" ];
+
+  postBuild = lib.optionalString (!brokenPandoc) ''
+    pushd Documentation/
+    mkdir -p $out/share/man/man1
+    # taken from Documentation/MANPAGE-render.bash
+    pandoc MANPAGE.md -s -t man -o $out/share/man/man1/gocryptfs.1
+    pandoc MANPAGE-XRAY.md -s -t man -o $out/share/man/man1/gocryptfs-xray.1
+    pandoc MANPAGE-STATFS.md -s -t man -o $out/share/man/man1/statfs.1
+    popd
+  '';
+
+  meta = with lib; {
+    description = "Encrypted overlay filesystem written in Go";
+    license = licenses.mit;
+    homepage = "https://nuetzlich.net/gocryptfs/";
+    maintainers = with maintainers; [ flokli offline prusnak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/gpart/default.nix b/nixpkgs/pkgs/tools/filesystems/gpart/default.nix
new file mode 100644
index 000000000000..eafbe066ac94
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/gpart/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "gpart";
+  version = "0.3";
+
+  # GitHub repository 'collating patches for gpart from all distributions':
+  src = fetchFromGitHub {
+    sha256 = "1lsd9k876p944k9s6sxqk5yh9yr7m42nbw9vlsllin7pd4djl4ya";
+    rev = version;
+    repo = "gpart";
+    owner = "baruch";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Guess PC-type hard disk partitions";
+    longDescription = ''
+      Gpart is a tool which tries to guess the primary partition table of a
+      PC-type hard disk in case the primary partition table in sector 0 is
+      damaged, incorrect or deleted. The guessed table can be written to a file
+      or device.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/grive2/default.nix b/nixpkgs/pkgs/tools/filesystems/grive2/default.nix
new file mode 100644
index 000000000000..68475b9e2908
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/grive2/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, yajl, cmake, libgcrypt, curl, expat, boost, libiberty }:
+
+stdenv.mkDerivation rec {
+  version = "0.5.1";
+  pname = "grive2";
+
+  src = fetchFromGitHub {
+    owner = "vitalif";
+    repo = "grive2";
+    rev =  "v${version}";
+    sha256 = "1kv34ys8qarjsxpb1kd8dp7b3b4ycyiwjzd6mg97d3jk7405g6nm";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ libgcrypt yajl curl expat stdenv boost libiberty ];
+
+  meta = with lib; {
+    description = "A console Google Drive client";
+    homepage = "https://github.com/vitalif/grive2";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix
new file mode 100644
index 000000000000..8a2a8572b5ca
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, openssl, libbsd }:
+
+let version = "332.25";
+    package_name = "hfsprogs"; in
+stdenv.mkDerivation {
+  name = "${package_name}-${version}";
+  srcs = [
+    (fetchurl {
+      url = "http://ftp.de.debian.org/debian/pool/main/h/hfsprogs/${package_name}_${version}-11.debian.tar.gz";
+      sha256 = "62d9b8599c66ebffbc57ce5d776e20b41341130d9b27341d63bda08460ebde7c";
+    })
+    (fetchurl {
+      url = "https://opensource.apple.com/tarballs/diskdev_cmds/diskdev_cmds-${version}.tar.gz";
+      sha256 = "74c9aeca899ed7f4bf155c65fc45bf0f250c0f6d57360ea953b1d536d9aa45e6";
+    })
+  ];
+
+  postPatch = ''
+    sed -ie '/sys\/sysctl.h/d' newfs_hfs.tproj/makehfs.c
+  '';
+
+  sourceRoot = "diskdev_cmds-" + version;
+  patches = [ "../debian/patches/*.patch" ];
+
+  buildInputs = [ openssl libbsd ];
+  makefile = "Makefile.lnx";
+
+  # Inspired by PKGBUILD of https://www.archlinux.org/packages/community/x86_64/hfsprogs/
+  installPhase = ''
+    # Create required package directories
+    install -m 755 -d "$out/bin"
+    install -m 755 -d "$out/share/${package_name}"
+    install -m 755 -d "$out/share/man/man8/"
+    # Copy executables
+    install -m 755 "newfs_hfs.tproj/newfs_hfs" "$out/bin/mkfs.hfsplus"
+    install -m 755 "fsck_hfs.tproj/fsck_hfs" "$out/bin/fsck.hfsplus"
+    # Copy shared data
+    install -m 644 "newfs_hfs.tproj/hfsbootdata.img" "$out/share/${package_name}/hfsbootdata"
+    # Copy man pages
+    install -m 644 "newfs_hfs.tproj/newfs_hfs.8" "$out/share/man/man8/mkfs.hfsplus.8"
+    install -m 644 "fsck_hfs.tproj/fsck_hfs.8" "$out/share/man/man8/fsck.hfsplus.8"
+  '';
+
+  meta = {
+    description = "HFS/HFS+ user space utils";
+    license = lib.licenses.apsl20;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix
new file mode 100644
index 000000000000..f107add29c0d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix
@@ -0,0 +1,35 @@
+{ fetchurl, lib, stdenv, pkg-config, fuse, openssl, asciidoc
+, docbook_xml_dtd_45, docbook_xsl , libxml2, libxslt }:
+
+stdenv.mkDerivation rec {
+  name = "httpfs2-0.1.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/httpfs/httpfs2/${name}.tar.gz";
+    sha256 = "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1";
+  };
+
+  buildInputs =
+    [ pkg-config fuse openssl
+      asciidoc docbook_xml_dtd_45 docbook_xsl libxml2 libxslt
+    ];
+
+  installPhase =
+    '' mkdir -p "$out/bin"
+       cp -v httpfs2 "$out/bin"
+
+       mkdir -p "$out/share/man/man1"
+       cp -v *.1 "$out/share/man/man1"
+    '';
+
+  meta = {
+    description = "FUSE-based HTTP filesystem for Linux";
+
+    homepage = "http://httpfs.sourceforge.net/";
+
+    license = lib.licenses.gpl2Plus;
+
+    platforms = lib.platforms.unix;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix
new file mode 100644
index 000000000000..0ebc1f232234
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, curl, openssl, fuse, libxml2, json_c, file }:
+
+stdenv.mkDerivation rec {
+  pname = "hubicfuse";
+  version = "3.0.1";
+
+  src = fetchFromGitHub {
+    owner = "TurboGit";
+    repo = "hubicfuse";
+    rev = "v${version}";
+    sha256 = "1x988hfffxgvqxh083pv3lj5031fz03sbgiiwrjpaiywfbhm8ffr";
+  };
+
+  patches = [
+    # Fix Darwin build
+    # https://github.com/TurboGit/hubicfuse/pull/159
+    (fetchpatch {
+      url = "https://github.com/TurboGit/hubicfuse/commit/b460f40d86bc281a21379158a7534dfb9f283786.patch";
+      sha256 = "0nqvcbrgbc5dms8fkz3brlj40yn48p36drabrnc26gvb3hydh5dl";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ curl openssl fuse libxml2 json_c file ];
+  postInstall = ''
+    install hubic_token $out/bin
+    mkdir -p $out/sbin
+    ln -sf $out/bin/hubicfuse $out/sbin/mount.hubicfuse
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/TurboGit/hubicfuse";
+    description = "FUSE-based filesystem to access hubic cloud storage";
+    platforms = platforms.unix;
+    license = licenses.mit;
+    maintainers = [ maintainers.jpierre03 ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/idsk/default.nix b/nixpkgs/pkgs/tools/filesystems/idsk/default.nix
new file mode 100644
index 000000000000..0b7ae339053c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/idsk/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+
+  pname = "idsk";
+  version = "0.20";
+
+  src = fetchFromGitHub {
+    repo = "idsk";
+    owner = "cpcsdk";
+    rev = "v${version}";
+    sha256 = "05zbdkb9s6sfkni6k927795w2fqdhnf3i7kgl27715sdmmdab05d";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp iDSK $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Manipulating CPC dsk images and files";
+    homepage = "https://github.com/cpcsdk/idsk" ;
+    license = licenses.mit;
+    maintainers = [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix b/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix
new file mode 100644
index 000000000000..09be33384d50
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, usbmuxd, fuse, libimobiledevice }:
+
+stdenv.mkDerivation rec {
+  pname = "ifuse";
+  version = "1.1.4";
+
+  src = fetchFromGitHub {
+    owner = "libimobiledevice";
+    repo = pname;
+    rev = version;
+    sha256 = "1r12y3h1j7ikkwk874h9969kr4ksyamvrwywx19ml6rsr01arw84";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config fuse usbmuxd libimobiledevice ];
+
+  meta = with lib; {
+    homepage = "https://github.com/libimobiledevice/ifuse";
+    description = "A fuse filesystem implementation to access the contents of iOS devices";
+    longDescription = ''
+      Mount directories of an iOS device locally using fuse. By default the media
+      directory is mounted, options allow to also mount the sandbox container of an
+      app, an app's documents folder or even the root filesystem on jailbroken
+      devices.
+    '';
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ infinisil ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/irods/common.nix b/nixpkgs/pkgs/tools/filesystems/irods/common.nix
new file mode 100644
index 000000000000..87bb2b9051ce
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/irods/common.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, libkrb5, gcc, libcxx, which, catch2 }:
+
+# Common attributes of irods packages
+
+{
+  nativeBuildInputs = [ autoconf automake cmake gnumake help2man texinfo which gcc ];
+  buildInputs = [ bzip2 zlib libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc libkrb5 boost libcxx catch2 ];
+
+  cmakeFlags = [
+    "-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}"
+    "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}"
+    "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}"
+    "-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}"
+    "-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}"
+    "-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}"
+    "-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}"
+    "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}"
+    "-DIRODS_EXTERNALS_FULLPATH_CATCH2=${catch2}"
+    "-DIRODS_LINUX_DISTRIBUTION_NAME=nix"
+    "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}"
+    "-DCPACK_GENERATOR=TGZ"
+    "-DCMAKE_CXX_FLAGS=-I${lib.getDev libcxx}/include/c++/v1"
+  ];
+
+  preConfigure = ''
+    patchShebangs ./packaging
+    patchShebangs ./scripts
+    substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin"
+    substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/"
+    substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/"
+    export cmakeFlags="$cmakeFlags
+      -DCMAKE_INSTALL_PREFIX=$out
+    "
+  '';
+
+  meta = with lib; {
+    description = "Integrated Rule-Oriented Data System (iRODS)";
+    longDescription = ''
+      The Integrated Rule-Oriented Data System (iRODS) is open source data management
+      software used by research organizations and government agencies worldwide.
+      iRODS is released as a production-level distribution aimed at deployment in mission
+      critical environments.  It virtualizes data storage resources, so users can take
+      control of their data, regardless of where and on what device the data is stored.
+      As data volumes grow and data services become more complex, iRODS is increasingly
+      important in data management. The development infrastructure supports exhaustive
+      testing on supported platforms; plug-in support for microservices, storage resources,
+      drivers, and databases; and extensive documentation, training and support services.'';
+    homepage = "https://irods.org";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.bzizou ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/irods/default.nix b/nixpkgs/pkgs/tools/filesystems/irods/default.nix
new file mode 100644
index 000000000000..cbc9f19c664a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/irods/default.nix
@@ -0,0 +1,97 @@
+{ lib, stdenv, fetchFromGitHub, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp_llvm, boost, jansson, zeromq, openssl , pam, libiodbc, libkrb5, gcc, libcxx, which, catch2 }:
+
+let
+  avro-cpp=avro-cpp_llvm;
+in
+let
+  common = import ./common.nix {
+    inherit lib stdenv bzip2 zlib autoconf automake cmake gnumake
+            help2man texinfo libtool cppzmq libarchive jansson
+            zeromq openssl pam libiodbc libkrb5 gcc libcxx
+            boost avro-cpp which catch2;
+  };
+in rec {
+
+  # irods: libs and server package
+  irods = stdenv.mkDerivation (common // rec {
+    version = "4.2.7";
+    pname = "irods";
+
+    src = fetchFromGitHub {
+      owner = "irods";
+      repo = "irods";
+      rev = version;
+      sha256 = "1pd4l42z4igzf0l8xbp7yz0nhzsv47ziv5qj8q1hh6pfhmwlzp9s";
+      fetchSubmodules = true;
+    };
+
+    # Patches:
+    # irods_root_path.patch : the root path is obtained by stripping 3 items of the path,
+    #                         but we don't use /usr with nix, so remove only 2 items.
+    patches = [ ./irods_root_path.patch ];
+
+    # fix build with recent llvm versions
+    NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations";
+
+    preConfigure = common.preConfigure + ''
+      patchShebangs ./test
+      substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp"
+      substituteInPlace cmake/server.cmake --replace "DESTINATION usr/sbin" "DESTINATION sbin"
+      substituteInPlace cmake/server.cmake --replace "IRODS_DOC_DIR usr/share" "IRODS_DOC_DIR share"
+      substituteInPlace cmake/runtime_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
+      substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib"
+      substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/include" "DESTINATION include"
+      for file in unit_tests/cmake/test_config/*.cmake
+      do
+        substituteInPlace $file --replace "CATCH2}/include" "CATCH2}/include/catch2"
+      done
+      export cmakeFlags="$cmakeFlags
+        -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib
+        "
+
+      substituteInPlace cmake/server.cmake --replace SETUID ""
+    '';
+
+    meta = common.meta // {
+      longDescription = common.meta.longDescription + "This package provides the servers and libraries.";
+    };
+  });
+
+
+  # icommands (CLI) package, depends on the irods package
+  irods-icommands = stdenv.mkDerivation (common // rec {
+     version = "4.2.7";
+     pname = "irods-icommands";
+
+     src = fetchFromGitHub {
+       owner = "irods";
+       repo = "irods_client_icommands";
+       rev = version;
+       sha256 = "08hqrc9iaw0y9rrrcknnl5mzbcrsvqc39pwvm62fipl3vnfqryli";
+     };
+
+     patches = [ ./zmqcpp-deprecated-send_recv.patch ];
+
+     buildInputs = common.buildInputs ++ [ irods ];
+
+     preConfigure = common.preConfigure + ''
+       patchShebangs ./bin
+     '';
+
+     cmakeFlags = common.cmakeFlags ++ [
+       "-DCMAKE_INSTALL_PREFIX=${stdenv.out}"
+       "-DIRODS_DIR=${irods}/lib/irods/cmake"
+       "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+       "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+       "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib"
+    ];
+
+     meta = common.meta // {
+       description = common.meta.description + " CLI clients";
+       longDescription = common.meta.longDescription + "This package provides the CLI clients, called 'icommands'.";
+     };
+  });
+}
+
diff --git a/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch b/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch
new file mode 100644
index 000000000000..16b6ba08cbb2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch
@@ -0,0 +1,71 @@
+diff -r -u irods-4.2.0.orig/lib/core/src/irods_default_paths.cpp irods-4.2.0/lib/core/src/irods_default_paths.cpp
+--- irods-4.2.0.orig/lib/core/src/irods_default_paths.cpp	2016-11-15 06:23:55.000000000 +0000
++++ irods-4.2.0/lib/core/src/irods_default_paths.cpp	2016-12-20 18:03:17.156883399 +0000
+@@ -18,7 +18,7 @@
+         try {
+             boost::filesystem::path path{dl_info.dli_fname};
+             path = boost::filesystem::canonical(path);
+-            path.remove_filename().remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
++            path.remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install
+             return path;
+         } catch(const boost::filesystem::filesystem_error& e) {
+             THROW(-1, e.what());
+@@ -27,8 +27,7 @@
+ 
+     boost::filesystem::path
+     get_irods_config_directory() {
+-        boost::filesystem::path path{get_irods_root_directory()};
+-        path.append("etc").append("irods");
++        boost::filesystem::path path("/etc/irods");
+         return path;
+     }
+ 
+diff -r -u irods-4.2.0.orig/scripts/irods/paths.py irods-4.2.0/scripts/irods/paths.py
+--- irods-4.2.0.orig/scripts/irods/paths.py	2016-11-15 06:23:55.000000000 +0000
++++ irods-4.2.0/scripts/irods/paths.py	2016-12-21 15:17:07.437864606 +0000
+@@ -10,7 +10,7 @@
+     return os.path.join(root_directory(), 'var', 'lib', 'irods')
+ 
+ def config_directory():
+-    return os.path.join(root_directory(), 'etc', 'irods')
++    return os.path.join(os.path.abspath('/'), 'etc', 'irods')
+ 
+ def plugins_directory():
+     return os.path.join(root_directory(), 'usr', 'lib', 'irods', 'plugins')
+@@ -37,7 +37,7 @@
+ 
+ def version_path():
+     return os.path.join(
+-        irods_directory(),
++        home_directory(),
+         'VERSION.json')
+ 
+ def hosts_config_path():
+@@ -64,7 +64,7 @@
+ 
+ def log_directory():
+     return os.path.join(
+-        irods_directory(),
++        home_directory(),
+         'log')
+ 
+ def control_log_path():
+@@ -110,8 +110,7 @@
+ def server_bin_directory():
+     return os.path.join(
+         root_directory(),
+-        'usr',
+-        'sbin')
++        'bin')
+ 
+ def server_executable():
+     return os.path.join(
+@@ -132,7 +131,7 @@
+     return os.path.join(config_directory(), 'service_account.config')
+ 
+ def genosauth_path():
+-    return os.path.join(irods_directory(), 'clients', 'bin', 'genOSAuth')
++    return os.path.join(home_directory(), 'clients', 'bin', 'genOSAuth')
+ 
+ def irods_user_and_group_entries():
+     try:
diff --git a/nixpkgs/pkgs/tools/filesystems/irods/zmqcpp-deprecated-send_recv.patch b/nixpkgs/pkgs/tools/filesystems/irods/zmqcpp-deprecated-send_recv.patch
new file mode 100644
index 000000000000..8c249dc4745b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/irods/zmqcpp-deprecated-send_recv.patch
@@ -0,0 +1,21 @@
+diff -r -u source/src/irods-grid.cpp source.new/src/irods-grid.cpp
+--- source/src/irods-grid.cpp	1970-01-01 01:00:01.000000000 +0100
++++ source.new/src/irods-grid.cpp	2020-05-05 16:34:35.566464346 +0200
+@@ -412,7 +412,7 @@
+             data_to_send.data(),
+             data_to_send.size() );
+         try {
+-            if (!zmq_skt.send(req)) {
++            if (!zmq_skt.send( req, zmq::send_flags::dontwait )) {
+                 std::cerr << "ZeroMQ encountered an error sending a message.\n";
+                 return errno;
+             }
+@@ -426,7 +426,7 @@
+         zmq::message_t rep;
+         // wait for the server reponse
+         try {
+-            if (!zmq_skt.recv( &rep )) {
++            if (!zmq_skt.recv( rep, zmq::recv_flags::dontwait )) {
+                 std::cerr << "ZeroMQ encountered an error receiving a message.\n";
+                 return errno;
+             }
diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch
new file mode 100644
index 000000000000..697029cd5a8c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch
@@ -0,0 +1,10 @@
+--- jfsutils-1.1.15/configure.in.orig	2018-11-27 20:46:55.830242385 +0300
++++ jfsutils-1.1.15/configure.in	2018-11-27 20:47:00.596307630 +0300
+@@ -15,6 +15,7 @@
+ AC_PATH_PROG(LN, ln, ln)
+ AC_PROG_LN_S
+ AC_PROG_RANLIB
++AM_PROG_AR
+ 
+ dnl Checks for header files.
+ AC_HEADER_STDC
diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix b/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix
new file mode 100644
index 000000000000..fadc639fbf63
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, fetchpatch, libuuid, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "jfsutils-1.1.15";
+
+  src = fetchurl {
+    url = "http://jfs.sourceforge.net/project/pub/${name}.tar.gz";
+    sha256 = "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4";
+  };
+
+  patches = [
+    ./types.patch
+    ./hardening-format.patch
+    # required for cross-compilation
+    ./ar-fix.patch
+    # fix for glibc>=2.28
+    (fetchpatch {
+      name   = "add_sysmacros.patch";
+      url    = "https://sources.debian.org/data/main/j/jfsutils/1.1.15-4/debian/patches/add_sysmacros.patch";
+      sha256 = "1qcwvxs4d0d24w5x98z59arqfx2n7f0d9xaqhjcg6w8n34vkhnyc";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ libuuid ];
+
+  meta = with lib; {
+    description = "IBM JFS utilities";
+    homepage = "http://jfs.sourceforge.net";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch
new file mode 100644
index 000000000000..dd2a93a81ec6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch
@@ -0,0 +1,37 @@
+--- a/fscklog/fscklog.c	2016-01-29 04:59:54.102223291 +0000
++++ b/fscklog/fscklog.c	2016-01-29 05:00:10.707552565 +0000
+@@ -252,8 +252,8 @@
+ 
+ 	sprintf(debug_detail, " [%s:%d]\n", basename(file_name), line_number);
+ 
+-	printf(msg_string);
+-	printf(debug_detail);
++	printf("%s", msg_string);
++	printf("%s", debug_detail);
+ 
+ 	return 0;
+ }
+--- a/fscklog/display.c	2016-01-29 05:05:42.582133444 +0000
++++ b/fscklog/display.c	2016-01-29 05:05:47.541231780 +0000
+@@ -182,7 +182,7 @@
+ 				} else {
+ 					/* the record looks ok */
+ 					msg_txt = &log_entry[log_entry_pos];
+-					printf(msg_txt);
++					printf("%s", msg_txt);
+ 					/*
+ 					 * set up for the next record
+ 					 */
+--- a/logdump/helpers.c	2016-01-29 05:06:26.081996021 +0000
++++ b/logdump/helpers.c	2016-01-29 05:06:43.097333425 +0000
+@@ -95,8 +95,8 @@
+ 
+ 	sprintf(debug_detail, " [%s:%d]\n", file_name, line_number);
+ 
+-	printf(msg_string);
+-	printf(debug_detail);
++	printf("%s", msg_string);
++	printf("%s", debug_detail);
+ 
+ 	return 0;
+ }
diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch
new file mode 100644
index 000000000000..a682f2695f9e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' jfsutils-1.1.15-orig/libfs/devices.h jfsutils-1.1.15/libfs/devices.h
+--- jfsutils-1.1.15-orig/libfs/devices.h	2005-11-22 21:43:55.000000000 +0100
++++ jfsutils-1.1.15/libfs/devices.h	2013-01-28 13:58:56.888630278 +0100
+@@ -18,6 +18,8 @@
+ #ifndef H_DEVICES
+ #define H_DEVICES
+ 
++#include <inttypes.h>
++
+ #define GET	0
+ #define PUT	1
+ #define VRFY	2
diff --git a/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix
new file mode 100644
index 000000000000..8589abffc77d
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, file, fuse, libmtp }:
+
+let version = "0.5"; in
+stdenv.mkDerivation {
+  pname = "jmtpfs";
+  inherit version;
+
+  src = fetchFromGitHub {
+    sha256 = "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1";
+    rev = "v${version}";
+    repo = "jmtpfs";
+    owner = "JasonFerrara";
+  };
+
+  patches = [
+    # Fix Darwin build (https://github.com/JasonFerrara/jmtpfs/pull/12)
+    (fetchpatch {
+      url = "https://github.com/JasonFerrara/jmtpfs/commit/b89084303477d1bc4dc9a887ba9cdd75221f497d.patch";
+      sha256 = "0s7x3jfk8i86rd5bwhj7mb1lffcdlpj9bd7b41s1768ady91rb29";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ file fuse libmtp ];
+
+  meta = with lib; {
+    description = "A FUSE filesystem for MTP devices like Android phones";
+    homepage = "https://github.com/JasonFerrara/jmtpfs";
+    license = licenses.gpl3Only;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.coconnor ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix b/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix
new file mode 100644
index 000000000000..a9e0cd12d9d4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, makeWrapper
+, python3
+, db
+, fuse
+, asciidoc
+, libxml2
+, libxslt
+, docbook_xml_dtd_412
+, docbook_xsl
+, boost
+, pkg-config
+, judy
+, pam
+, spdlog
+, fmt
+, systemdMinimal
+, zlib # optional
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lizardfs";
+  version = "3.13.0-rc3";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-rgaFhJvmA1RVDL4+vQLMC0GrdlgUlvJeZ5/JJ67C20Q=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config makeWrapper ];
+
+  buildInputs = [
+    db fuse asciidoc libxml2 libxslt docbook_xml_dtd_412 docbook_xsl
+    zlib boost judy pam spdlog fmt python3 systemdMinimal
+  ];
+
+  meta = with lib; {
+    homepage = "https://lizardfs.com";
+    description = "A highly reliable, scalable and efficient distributed file system";
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ rushmorem shamilton ];
+    # 'fprintf' was not declared in this scope
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix
new file mode 100644
index 000000000000..6f0a40d76afe
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, pkg-config, gettext, libtool, pandoc, which, attr, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "mergerfs";
+  version = "2.32.4";
+
+  src = fetchFromGitHub {
+    owner = "trapexit";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-VTnAAJWya1JLZA0gjzpUsdnO5XQP8sJzEP8qHBH+t5k=";
+  };
+
+  nativeBuildInputs = [
+    automake autoconf pkg-config gettext libtool pandoc which
+  ];
+  prePatch = ''
+    sed -i -e '/chown/d' -e '/chmod/d' libfuse/Makefile
+  '';
+  buildInputs = [ attr libiconv ];
+
+  preConfigure = ''
+    echo "${version}" > VERSION
+  '';
+
+  makeFlags = [ "DESTDIR=${placeholder "out"}" "XATTR_AVAILABLE=1" "PREFIX=/" "SBINDIR=/bin" ];
+  enableParallelBuilding = true;
+
+  postFixup = ''
+    ln -srf $out/bin/mergerfs $out/bin/mount.fuse.mergerfs
+    ln -srf $out/bin/mergerfs $out/bin/mount.mergerfs
+  '';
+
+  meta = {
+    description = "A FUSE based union filesystem";
+    homepage = "https://github.com/trapexit/mergerfs";
+    license = lib.licenses.isc;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ jfrankenau makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix b/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix
new file mode 100644
index 000000000000..e559fd9d4cd0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, coreutils, makeWrapper
+, rsync, python3, pythonPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "mergerfs-tools";
+  version = "20190411";
+
+  src = fetchFromGitHub {
+    owner = "trapexit";
+    repo = pname;
+    rev = "6e41fc5848c7cc4408caea86f3991c8cc2ac85a1";
+    sha256 = "0izswg6bya13scvb37l3gkl7mvi8q7l11p4hp4phdlcwh9jvdzcj";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ python3 ];
+
+  makeFlags = [
+    "INSTALL=${coreutils}/bin/install"
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  postInstall = with lib; ''
+    wrapProgram $out/bin/mergerfs.balance --prefix PATH : ${makeBinPath [ rsync ]}
+    wrapProgram $out/bin/mergerfs.dup --prefix PATH : ${makeBinPath [ rsync ]}
+    wrapProgram $out/bin/mergerfs.mktrash --prefix PATH : ${makeBinPath [ pythonPackages.xattr ]}
+  '';
+
+  meta = with lib; {
+    description = "Optional tools to help manage data in a mergerfs pool";
+    homepage = "https://github.com/trapexit/mergerfs-tools";
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix
new file mode 100644
index 000000000000..3a0d0ab2f65b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, fuse, pkg-config, attr, uthash }:
+
+stdenv.mkDerivation rec {
+  pname = "mhddfs";
+  version = "0.1.39";
+
+  src = fetchurl {
+    url = "http://mhddfs.uvw.ru/downloads/mhddfs_${version}.tar.gz";
+    sha256 = "14ggmh91vv69fp2qpz0nxp0hprlw2wsijss2k2485hb0ci4cabvh";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse attr uthash ];
+
+  patches = [
+    ./fix-format-security-error.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace src/main.c --replace "attr/xattr.h" "sys/xattr.h"
+    substituteInPlace src/tools.c --replace "attr/xattr.h" "sys/xattr.h"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp mhddfs $out/bin/
+  '';
+
+  meta = {
+    homepage = "http://mhddfs.uvw.ru/";
+    description = "Combines a several mount points into the single one";
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch b/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch
new file mode 100644
index 000000000000..35e58cf0ce9e
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch
@@ -0,0 +1,12 @@
+--- mhddfs-0.1.39/src/usage.c.old	2017-02-28 15:00:25.435438622 +0100
++++ mhddfs-0.1.39/src/usage.c	2017-02-28 15:00:33.847454958 +0100
+@@ -43,7 +43,7 @@
+ 		"\n"
+ 		" see fusermount(1) for information about other options\n"
+ 		"";
+-	fprintf(to, usage);
++	fputs(usage, to);
+ 	if (to==stdout) exit(0);
+ 	exit(-1);
+ }
+
diff --git a/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix b/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix
new file mode 100644
index 000000000000..30312ec7dc7b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, git }:
+
+# Changing the variables CPPFLAGS and BUILD_CONFIG_NAME can be done by
+# overriding the same-named attributes. See ./presets.nix for examples.
+
+stdenv.mkDerivation rec {
+  pname = "mkspiffs";
+  version = "0.2.3";
+
+  src = fetchFromGitHub {
+    owner = "igrr";
+    repo = "mkspiffs";
+    rev = version;
+    fetchSubmodules = true;
+    sha256 = "1fgw1jqdlp83gv56mgnxpakky0q6i6f922niis4awvxjind8pbm1";
+  };
+
+  nativeBuildInputs = [ git ];
+  buildFlags = [ "dist" ];
+  installPhase = ''
+    mkdir -p $out/bin
+    cp mkspiffs $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Tool to build and unpack SPIFFS images";
+    license = licenses.mit;
+    homepage = "https://github.com/igrr/mkspiffs";
+    maintainers = with maintainers; [ haslersn ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix b/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix
new file mode 100644
index 000000000000..c0b74d9cf1b7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix
@@ -0,0 +1,20 @@
+{ lib, mkspiffs }:
+
+# We provide the same presets as the upstream
+
+lib.mapAttrs (
+  name: { CPPFLAGS }:
+  mkspiffs.overrideAttrs (drv: {
+    inherit CPPFLAGS;
+    BUILD_CONFIG_NAME = "-${name}";
+  })
+) {
+  arduino-esp8266.CPPFLAGS = [
+    "-DSPIFFS_USE_MAGIC_LENGTH=0"
+    "-DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=1"
+  ];
+
+  arduino-esp32.CPPFLAGS = [ "-DSPIFFS_OBJ_META_LEN=4" ];
+
+  esp-idf.CPPFLAGS = [ "-DSPIFFS_OBJ_META_LEN=4" ];
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix b/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix
new file mode 100644
index 000000000000..ee0d5eedc921
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchFromGitHub
+, makeWrapper
+, python
+, fuse
+, pkg-config
+, libpcap
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "moosefs";
+  version = "3.0.115";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0dap9dqwwx8adma6arxg015riqc86cmjv2m44hk0kz7s24h79ipq";
+  };
+
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+
+  buildInputs =
+    [ fuse libpcap zlib python ];
+
+  buildFlags = lib.optionals stdenv.isDarwin [ "CPPFLAGS=-UHAVE_STRUCT_STAT_ST_BIRTHTIME" ];
+
+  # Fix the build on macOS with macFUSE installed
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace \
+      "/usr/local/lib/pkgconfig" "/nonexistent"
+  '';
+
+  preBuild = lib.optional stdenv.isDarwin ''
+    substituteInPlace config.h --replace \
+      "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" \
+      "#undef HAVE_STRUCT_STAT_ST_BIRTHTIME"
+  '';
+
+  postInstall = ''
+    substituteInPlace $out/sbin/mfscgiserv --replace "datapath=\"$out" "datapath=\""
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://moosefs.com";
+    description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System";
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.mfossen ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix b/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix
new file mode 100644
index 000000000000..1b80adc843a6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, flac, fuse, lame, libid3tag, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "mp3fs";
+  version = "0.91";
+
+  src = fetchurl {
+    url = "https://github.com/khenriks/mp3fs/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "14ngiqg24p3a0s6hp33zjl4i46d8qn4v9id36psycq3n3csmwyx4";
+  };
+
+  patches = [ ./fix-statfs-operation.patch ];
+
+  buildInputs = [ flac fuse lame libid3tag ];
+  nativeBuildInputs = [ pkg-config ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "FUSE file system that transparently transcodes to MP3";
+    longDescription = ''
+      A read-only FUSE filesystem which transcodes between audio formats
+      (currently only FLAC to MP3) on the fly when files are opened and read.
+      It can let you use a FLAC collection with software and/or hardware
+      which only understands the MP3 format, or transcode files through
+      simple drag-and-drop in a file browser.
+    '';
+    homepage = "https://khenriks.github.io/mp3fs/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch b/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch
new file mode 100644
index 000000000000..9b3094e60053
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch
@@ -0,0 +1,39 @@
+From fea072084ff9d7c4d2c688059a2462bb0e59a2ec Mon Sep 17 00:00:00 2001
+From: K Henriksson <kthenriksson@gmail.com>
+Date: Wed, 27 Aug 2014 21:55:18 -0700
+Subject: [PATCH] Fix statfs operation
+
+The statfs implementation does not properly translate names back to the
+original, since the major encoding rewrite. This corrects that, and
+should fix issue #27.
+---
+ src/fuseops.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/fuseops.c b/src/fuseops.c
+index e7b4e7e..c333cbd 100644
+--- a/src/fuseops.c
++++ b/src/fuseops.c
+@@ -337,9 +337,20 @@ static int mp3fs_statfs(const char *path, struct statvfs *stbuf) {
+     if (!origpath) {
+         goto translate_fail;
+     }
+-    
++
++    /* pass-through for regular files */
++    if (statvfs(origpath, stbuf) == 0) {
++        goto passthrough;
++    } else {
++        /* Not really an error. */
++        errno = 0;
++    }
++
++    find_original(origpath);
++
+     statvfs(origpath, stbuf);
+-    
++
++passthrough:
+     free(origpath);
+ translate_fail:
+     return -errno;
diff --git a/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix b/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix
new file mode 100644
index 000000000000..cb40e72c30be
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, cmocka, acl, libuuid, lzo, zlib, zstd }:
+
+stdenv.mkDerivation rec {
+  pname = "mtd-utils";
+  version = "2.1.2";
+
+  src = fetchurl {
+    url = "ftp://ftp.infradead.org/pub/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-itTF80cW1AZGqihySi9WFtMlpvEZJU+RTiaXbx926dY=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ] ++ lib.optional doCheck cmocka;
+  buildInputs = [ acl libuuid lzo zlib zstd ];
+
+  configureFlags = with lib; [
+    (enableFeature doCheck "unit-tests")
+    (enableFeature doCheck "tests")
+  ];
+
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+
+  meta = with lib; {
+    description = "Tools for MTD filesystems";
+    license = licenses.gpl2Plus;
+    homepage = "http://www.linux-mtd.infradead.org/";
+    maintainers = with maintainers; [ viric superherointj ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch b/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch
new file mode 100644
index 000000000000..46b790afd30a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch
@@ -0,0 +1,11 @@
+--- mtools/sysincludes.h.orig	2017-04-01 20:59:46.083196540 +0100
++++ mtools/sysincludes.h	2017-04-01 20:59:12.855030456 +0100
+@@ -103,7 +103,7 @@
+ # define PACKED __attribute__ ((packed))
+ # if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3
+ /* gcc 2.6.3 doesn't have "unused" */		/* mool */
+-#  define UNUSED(x) x __attribute__ ((unused));x
++#  define UNUSED(x) x
+ #  define UNUSEDP __attribute__ ((unused))
+ # else
+ #  define UNUSED(x) x
diff --git a/nixpkgs/pkgs/tools/filesystems/mtools/default.nix b/nixpkgs/pkgs/tools/filesystems/mtools/default.nix
new file mode 100644
index 000000000000..8f83f800b671
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mtools/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mtools";
+  version = "4.0.27";
+
+  src = fetchurl {
+    url = "mirror://gnu/mtools/${pname}-${version}.tar.bz2";
+    sha256 = "1crqi10adwfahj8xyw60lx70hkpcc5g00b5r8277cm2f4kcwi24w";
+  };
+
+  patches = lib.optional stdenv.isDarwin ./UNUSED-darwin.patch;
+
+  # fails to find X on darwin
+  configureFlags = lib.optional stdenv.isDarwin "--without-x";
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/mtools/";
+    description = "Utilities to access MS-DOS disks";
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix
new file mode 100644
index 000000000000..e0b1cffe4dd7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, fuse, libmtp, glib, libmad, libid3tag }:
+
+stdenv.mkDerivation rec {
+  name = "mtpfs-1.1";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ fuse libmtp glib libid3tag libmad ];
+
+  # adding LIBS is a hack, duno why it does not find libid3tag.so by adding buildInputs
+  preConfigure = ''
+    export MAD_CFLAGS=${libmad}/include
+    export MAD_LIBS=${libmad}/lib/libmad.so
+    export LIBS=${libid3tag}/lib/libid3tag.so
+  '';
+
+  src = fetchurl {
+    url = "https://www.adebenham.com/files/mtp/${name}.tar.gz";
+    sha256 = "07acrqb17kpif2xcsqfqh5j4axvsa4rnh6xwnpqab5b9w5ykbbqv";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/cjd/mtpfs";
+    description = "FUSE Filesystem providing access to MTP devices";
+    platforms = platforms.all;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.qknight ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix b/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix
new file mode 100644
index 000000000000..486963f44b9a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix
@@ -0,0 +1,61 @@
+{ fetchurl, lib, stdenv, autoreconfHook, pkg-config, perl, python
+, db, libgcrypt, avahi, libiconv, pam, openssl, acl
+, ed, libtirpc, libevent
+}:
+
+stdenv.mkDerivation rec {
+  name = "netatalk-3.1.12";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/netatalk/netatalk/${name}.tar.bz2";
+    sha256 = "1ld5mnz88ixic21m6f0xcgf8v6qm08j6xabh1dzfj6x47lxghq0m";
+  };
+
+  patches = [
+    ./no-suid.patch
+    ./omitLocalstatedirCreation.patch
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config perl python python.pkgs.wrapPython ];
+
+  buildInputs = [ db libgcrypt avahi libiconv pam openssl acl libevent ];
+
+  configureFlags = [
+    "--with-bdb=${db.dev}"
+    "--with-ssl-dir=${openssl.dev}"
+    "--with-lockfile=/run/lock/netatalk"
+    "--with-libevent=${libevent.dev}"
+    "--localstatedir=/var/lib"
+  ];
+
+  # Expose librpcsvc to the linker for afpd
+  # Fixes errors that showed up when closure-size was merged:
+  # afpd-nfsquota.o: In function `callaurpc':
+  # netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_args'
+  # netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_rslt'
+  postConfigure = ''
+    ${ed}/bin/ed -v etc/afpd/Makefile << EOF
+    /^afpd_LDADD
+    /am__append_2
+    a
+      ${libtirpc}/lib/libtirpc.so \\
+    .
+    w
+    EOF
+  '';
+
+  postInstall = ''
+    buildPythonPath ${python.pkgs.dbus-python}
+    patchPythonScript $out/bin/afpstats
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Apple Filing Protocol Server";
+    homepage = "http://netatalk.sourceforge.net/";
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch b/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch
new file mode 100644
index 000000000000..194c1f5fac9f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch
@@ -0,0 +1,11 @@
+diff --git a/bin/afppasswd/Makefile.am b/bin/afppasswd/Makefile.am
+index 578eac1..d17aa22 100644
+--- a/bin/afppasswd/Makefile.am
++++ b/bin/afppasswd/Makefile.am
+@@ -16,5 +16,5 @@ AM_CFLAGS = @SSL_CFLAGS@ -I$(top_srcdir)/sys \
+ 
+ install-exec-hook:
+ if HAVE_OPENSSL
+-	chmod u+s $(DESTDIR)$(bindir)/afppasswd
++#	chmod u+s $(DESTDIR)$(bindir)/afppasswd
+ endif
diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch b/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch
new file mode 100644
index 000000000000..01c4ee9ba478
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch
@@ -0,0 +1,19 @@
+diff --git a/config/Makefile.am b/config/Makefile.am
+index c98a2ab..58b7f0a 100644
+--- a/config/Makefile.am
++++ b/config/Makefile.am
+@@ -36,10 +36,10 @@ endif
+ #
+ 
+ install-data-local: install-config-files
+-	mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/
+-	mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/
+-	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/
+-	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/
++#	mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/
++#	mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/
++#	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/
++#	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/
+ 
+ uninstall-local:
+ 	@for f in $(CONFFILES) $(GENFILES); do \
diff --git a/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix b/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix
new file mode 100644
index 000000000000..0639c6a6f21b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl, fetchpatch, libuuid, libselinux }:
+let
+  sourceInfo = rec {
+    version = "2.2.7";
+    url = "http://nilfs.sourceforge.net/download/nilfs-utils-${version}.tar.bz2";
+    sha256 = "01f09bvjk2crx65pxmxiw362wkkl3v2v144dfn3i7bk5gz253xic";
+    baseName = "nilfs-utils";
+    name = "${baseName}-${version}";
+  };
+in
+stdenv.mkDerivation {
+  src = fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.sha256;
+  };
+
+  inherit (sourceInfo) name version;
+  buildInputs = [libuuid libselinux];
+
+  preConfigure = ''
+    sed -e '/sysconfdir=\/etc/d; ' -i configure
+    sed -e "s@sbindir=/sbin@sbindir=$out/sbin@" -i configure
+    sed -e 's@/sbin/@'"$out"'/sbin/@' -i ./lib/cleaner*.c
+  '';
+
+  patches = [
+    # Fix w/musl
+    (fetchpatch {
+      url = "https://github.com/nilfs-dev/nilfs-utils/commit/115fe4b976858c487cf83065f513d8626089579a.patch";
+      sha256 = "0h89jz9l5d4rqj647ljbnv451l4ncqpsvzj0v70mn5391hfwsjlv";
+    })
+    (fetchpatch {
+      url =  "https://github.com/nilfs-dev/nilfs-utils/commit/51b32c614be9e98c32de7f531ee600ca0740946f.patch";
+      sha256 = "1ycq83c6jjy74aif47v075k5y2szzwhq6mbcrpd1z4b4i1x6yhpn";
+    })
+  ];
+
+  configureFlags = [
+    "--with-libmount"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    # AC_FUNC_MALLOC is broken on cross builds.
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  # FIXME: https://github.com/NixOS/patchelf/pull/98 is in, but stdenv
+  # still doesn't use it
+  #
+  # To make sure patchelf doesn't mistakenly keep the reference via
+  # build directory
+  postInstall = ''
+    find . -name .libs | xargs rm -rf
+  '';
+
+  meta = with lib; {
+    description = "NILFS utilities";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+    license =  with licenses; [ gpl2 lgpl21 ];
+    downloadPage = "http://nilfs.sourceforge.net/en/download.html";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix
new file mode 100644
index 000000000000..94ed258d3322
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix
@@ -0,0 +1,50 @@
+# FIXME: Unify with pkgs/development/python-modules/blivet/default.nix.
+
+{ lib, fetchurl, buildPythonApplication, pykickstart, pyparted, pyblock
+, libselinux, cryptsetup, multipath_tools, lsof, util-linux
+, useNixUdev ? true, systemd ? null
+# useNixUdev is here for bw compatibility
+}:
+
+assert useNixUdev -> systemd != null;
+
+buildPythonApplication rec {
+  pname = "blivet";
+  version = "0.17-1";
+
+  src = fetchurl {
+    url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/"
+        + "${pname}-${version}.tar.bz2";
+    sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci";
+  };
+
+  patches = [ ./blivet.patch ];
+
+  postPatch = ''
+    sed -i -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \
+      blivet/devicelibs/mpath.py blivet/devices.py
+    sed -i -e '/"wipefs"/ {
+      s|wipefs|${util-linux.bin}/sbin/wipefs|
+      s/-f/--force/
+    }' blivet/formats/__init__.py
+    sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py
+    sed -i -r -e 's|"(u?mount)"|"${util-linux.bin}/bin/\1"|' blivet/util.py
+    sed -i -e '/find_library/,/find_library/ {
+      c libudev = "${lib.getLib systemd}/lib/libudev.so.1"
+    }' blivet/pyudev.py
+  '';
+
+  propagatedBuildInputs = [
+    pykickstart pyparted pyblock libselinux cryptsetup
+  ] ++ lib.optional useNixUdev systemd;
+
+  # tests are currently _heavily_ broken upstream
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://fedoraproject.org/wiki/Blivet";
+    description = "Module for management of a system's storage configuration";
+    license = with licenses; [ gpl2Plus lgpl21Plus ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch
new file mode 100644
index 000000000000..d53231a84fd6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch
@@ -0,0 +1,51 @@
+diff --git a/blivet/pyudev.py b/blivet/pyudev.py
+index 705b93d..7268d71 100644
+--- a/blivet/pyudev.py
++++ b/blivet/pyudev.py
+@@ -7,9 +7,9 @@ from ctypes import *
+ 
+ 
+ # XXX this one may need some tweaking...
+-def find_library(name, somajor=0):
++def find_library(name):
+     env = os.environ.get("LD_LIBRARY_PATH")
+-    common = ["/lib64", "/lib"]
++    common = ["/lib64", "/lib", "/lib/x86_64-linux-gnu", "/lib/i686-linux-gnu"]
+ 
+     if env:
+         libdirs = env.split(":") + common
+@@ -19,7 +19,7 @@ def find_library(name, somajor=0):
+     libdirs = filter(os.path.isdir, libdirs)
+ 
+     for dir in libdirs:
+-        files = fnmatch.filter(os.listdir(dir), "lib%s.so.%d" % (name, somajor))
++        files = fnmatch.filter(os.listdir(dir), "lib%s.so.*" % name)
+         files = [os.path.join(dir, file) for file in files]
+ 
+         if files:
+@@ -32,11 +32,10 @@ def find_library(name, somajor=0):
+ 
+ # find the udev library
+ name = "udev"
+-somajor = 1
+-libudev = find_library(name=name, somajor=somajor)
++libudev = find_library(name)
+ 
+ if not libudev or not os.path.exists(libudev):
+-    raise ImportError, "No library named %s.%d" % (name, somajor)
++    raise ImportError, "No library named lib%s.so" % name
+ 
+ # load the udev library
+ libudev = CDLL(libudev)
+diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py
+index 705b93d..60f8f32 100644
+--- a/blivet/deviceaction.py
++++ b/blivet/deviceaction.py
+@@ -467,6 +467,7 @@ def execute(self):
+ 
+                 self.device.disk.format.commitToDisk()
+ 
++            self.device.setup()
+             self.device.format.create(device=self.device.path,
+                                       options=self.device.formatArgs)
+ 
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix
new file mode 100644
index 000000000000..6e372b75a7d7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, fetchpatch, lvm2, libgcrypt, libuuid, pkg-config, popt
+, enablePython ? true, python ? null
+}:
+
+assert enablePython -> python != null;
+
+stdenv.mkDerivation rec {
+  name = "cryptsetup-1.6.3";
+
+  src = fetchurl {
+    url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
+    sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2";
+  };
+
+  patches = [
+    # Fix build with glibc >= 2.28
+    # https://github.com/NixOS/nixpkgs/issues/86403
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryptsetup/files/cryptsetup-1.7.1-sysmacros.patch?id=d72316f97ebcc7fe622b21574442a9ac59b9115f";
+      sha256 = "0xbhazgl44bimqhcrhajk016w9wi7bkrgwyfq13xmrvyrllqvgdx";
+    })
+  ];
+
+  configureFlags = [ "--enable-cryptsetup-reencrypt" ]
+                ++ lib.optional enablePython "--enable-python";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ lvm2 libgcrypt libuuid popt ]
+             ++ lib.optional enablePython python;
+
+  meta = with lib; {
+    homepage = "http://code.google.com/p/cryptsetup/";
+    description = "LUKS for dm-crypt";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix
new file mode 100644
index 000000000000..7b773a61a5f2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix
@@ -0,0 +1,77 @@
+{ lib, stdenv, fetchurl, python, buildPythonApplication
+, libselinux
+# Propagated to blivet
+, useNixUdev ? true
+# Needed by NixOps
+, udevSoMajor ? null
+# Propagated dependencies
+, pkgs, urlgrabber
+}:
+
+let
+  blivet = import ./blivet.nix {
+    inherit lib fetchurl buildPythonApplication;
+    inherit pykickstart pyparted pyblock cryptsetup libselinux multipath_tools;
+    inherit useNixUdev;
+    inherit (pkgs) lsof util-linux systemd;
+  };
+
+  cryptsetup = import ./cryptsetup.nix {
+    inherit lib stdenv fetchurl python;
+    inherit (pkgs) fetchpatch pkg-config libgcrypt libuuid popt lvm2;
+  };
+
+  dmraid = import ./dmraid.nix {
+    inherit lib stdenv fetchurl lvm2;
+  };
+
+  lvm2 = import ./lvm2.nix {
+    inherit lib stdenv fetchurl;
+    inherit (pkgs) fetchpatch pkg-config util-linux systemd coreutils;
+  };
+
+  multipath_tools = import ./multipath-tools.nix {
+    inherit lib stdenv fetchurl lvm2;
+    inherit (pkgs) fetchpatch readline systemd libaio gzip;
+  };
+
+  parted = import ./parted.nix {
+    inherit lib stdenv fetchurl;
+    inherit (pkgs) fetchpatch util-linux readline libuuid gettext check lvm2;
+  };
+
+  pyblock = import ./pyblock.nix {
+    inherit lib stdenv fetchurl python lvm2 dmraid;
+  };
+
+  pykickstart = import ./pykickstart.nix {
+    inherit lib fetchurl python buildPythonApplication urlgrabber;
+  };
+
+  pyparted = import ./pyparted.nix {
+    inherit lib stdenv fetchurl python buildPythonApplication parted;
+    inherit (pkgs) pkg-config e2fsprogs;
+  };
+
+in buildPythonApplication rec {
+  pname = "nixpart";
+  version = "0.4.1";
+  disabled = python.isPy3k;
+
+  src = fetchurl {
+    url = "https://github.com/NixOS/nixpart/archive/v${version}.tar.gz";
+    sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp";
+  };
+
+  propagatedBuildInputs = [ blivet ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "NixOS storage manager/partitioner";
+    homepage = "https://github.com/NixOS/nixpart";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.aszlig ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix
new file mode 100644
index 000000000000..c5d8eebc47ca
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, lvm2 }:
+
+stdenv.mkDerivation rec {
+  name = "dmraid-1.0.0.rc15";
+
+  src = fetchurl {
+    url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2";
+    sha256 = "01bcaq0sc329ghgj7f182xws7jgjpdc41bvris8fsiprnxc7511h";
+  };
+
+  preConfigure = "cd */";
+
+  buildInputs = [ lvm2 ];
+
+  meta = with lib; {
+    description = "Old-style RAID configuration utility";
+    longDescription = ''
+      Old RAID configuration utility (still under development, though).
+      It is fully compatible with modern kernels and mdadm recognizes
+      its volumes. May be needed for rescuing an older system or nuking
+      the metadata when reformatting.
+    '';
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix
new file mode 100644
index 000000000000..ca349c7f42e4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, systemd, util-linux, coreutils }:
+
+let
+  v = "2.02.106";
+in
+
+stdenv.mkDerivation {
+  name = "lvm2-${v}";
+
+  src = fetchurl {
+    url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${v}.tgz";
+    sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc";
+  };
+
+  patches = [
+    # Fix build with glibc >= 2.28
+    # https://github.com/NixOS/nixpkgs/issues/86403
+    (fetchpatch {
+      url = "https://github.com/lvmteam/lvm2/commit/92d5a8441007f578e000b492cecf67d6b8a87405.patch";
+      sha256 = "1yqd6jng0b370k53vks1shg57yhfyribhpmv19km5zsjqf0qqx2d";
+      excludes = [
+        "libdm/libdm-stats.c"
+      ];
+    })
+  ];
+
+  configureFlags = [
+    "--disable-readline"
+    "--enable-udev_rules"
+    "--enable-udev_sync"
+    "--enable-pkg-config"
+    "--enable-applib"
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ systemd ];
+
+  preConfigure =
+    ''
+      substituteInPlace scripts/lvmdump.sh \
+        --replace /usr/bin/tr ${coreutils}/bin/tr
+      substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \
+        --replace /usr/sbin/lvm $out/sbin/lvm \
+        --replace /usr/bin/udevadm ${systemd}/bin/udevadm
+
+      sed -i /DEFAULT_SYS_DIR/d Makefile.in
+      sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in
+    '';
+
+  enableParallelBuilding = true;
+
+  #patches = [ ./purity.patch ];
+
+  # To prevent make install from failing.
+  installFlags = [ "OWNER=" "GROUP=" "confdir=${placeholder "out"}/etc" ];
+
+  # Install systemd stuff.
+  #installTargets = "install install_systemd_generators install_systemd_units install_tmpfiles_configuration";
+
+  postInstall =
+    ''
+      substituteInPlace $out/lib/udev/rules.d/13-dm-disk.rules \
+        --replace $out/sbin/blkid ${util-linux.bin}/sbin/blkid
+
+      # Systemd stuff
+      mkdir -p $out/etc/systemd/system $out/lib/systemd/system-generators
+      cp scripts/blk_availability_systemd_red_hat.service $out/etc/systemd/system
+      cp scripts/lvm2_activation_generator_systemd_red_hat $out/lib/systemd/system-generators
+    '';
+
+  meta = with lib; {
+    homepage = "http://sourceware.org/lvm2/";
+    description = "Tools to support Logical Volume Management (LVM) on Linux";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix
new file mode 100644
index 000000000000..976a3ce2567a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix
@@ -0,0 +1,53 @@
+# FIXME: unify with pkgs/os-specific/linux/multipath-tools/default.nix.
+
+{ lib, stdenv, fetchurl, fetchpatch, lvm2, libaio, gzip, readline, systemd }:
+
+stdenv.mkDerivation rec {
+  name = "multipath-tools-0.4.9";
+
+  src = fetchurl {
+    url = "http://christophe.varoqui.free.fr/multipath-tools/${name}.tar.bz2";
+    sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d";
+  };
+
+  patches = [
+    # Fix build with glibc >= 2.28
+    # https://github.com/NixOS/nixpkgs/issues/86403
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/multipath-tools/files/multipath-tools-0.6.4-sysmacros.patch?id=eb22b954c177b5c1e2b6ed5c7cdd02f40f40d757";
+      sha256 = "1an0cgmz7g03c4qjimhpm9fcf2iswws18lwqxi688k87qm3xb5qd";
+      excludes = [
+        "libmultipath/util.c"
+      ];
+    })
+  ];
+
+  sourceRoot = ".";
+
+  buildInputs = [ lvm2 libaio readline gzip ];
+
+  preBuild =
+    ''
+      makeFlagsArray=(GZIP="-9" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib)
+
+      substituteInPlace multipath/Makefile --replace /etc $out/etc
+      substituteInPlace kpartx/Makefile --replace /etc $out/etc
+
+      substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx
+      substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup
+
+      substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${lib.getLib systemd}/lib/udev/scsi_id
+      substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${lib.getLib systemd}/lib/udev/scsi_id
+
+      sed -i -re '
+         s,^( *#define +DEFAULT_MULTIPATHDIR\>).*,\1 "'"$out/lib/multipath"'",
+      ' libmultipath/defaults.h
+
+    '';
+
+  meta = with lib; {
+    description = "Tools for the Linux multipathing driver";
+    homepage = "http://christophe.varoqui.free.fr/";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix
new file mode 100644
index 000000000000..2891f990afb0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix
@@ -0,0 +1,61 @@
+{ lib,stdenv, fetchurl, fetchpatch, lvm2, libuuid, gettext, readline
+, util-linux, check
+, enableStatic ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  name = "parted-3.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/parted/${name}.tar.xz";
+    sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y";
+  };
+
+  patches = [
+    # Fix build with glibc >= 2.28
+    # https://github.com/NixOS/nixpkgs/issues/86403
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-block/parted/files/parted-3.2-sysmacros.patch?id=8e2414f551c14166f259f9a25a594aec7a5b9ea0";
+      sha256 = "0fdgifjbri7n28hv74zksac05gw72p2czzvyar0jp62b9dnql3mp";
+    })
+  ];
+
+  buildInputs = [ libuuid ]
+    ++ lib.optional (readline != null) readline
+    ++ lib.optional (gettext != null) gettext
+    ++ lib.optional (lvm2 != null) lvm2;
+
+  configureFlags =
+       (if (readline != null)
+        then [ "--with-readline" ]
+        else [ "--without-readline" ])
+    ++ lib.optional (lvm2 == null) "--disable-device-mapper"
+    ++ lib.optional enableStatic "--enable-static";
+
+  doCheck = true;
+  checkInputs = [ check util-linux ];
+
+  meta = with lib; {
+    description = "Create, destroy, resize, check, and copy partitions";
+
+    longDescription = ''
+      GNU Parted is an industrial-strength package for creating, destroying,
+      resizing, checking and copying partitions, and the file systems on
+      them.  This is useful for creating space for new operating systems,
+      reorganising disk usage, copying data on hard disks and disk imaging.
+
+      It contains a library, libparted, and a command-line frontend, parted,
+      which also serves as a sample implementation and script backend.
+    '';
+
+    homepage = "https://www.gnu.org/software/parted/";
+    license = licenses.gpl3Plus;
+
+    maintainers = [
+      # Add your name here!
+    ];
+
+    # GNU Parted requires libuuid, which is part of util-linux-ng.
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch
new file mode 100644
index 000000000000..b8ab7bd53b2b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock-sysmacros.h.patch
@@ -0,0 +1,12 @@
+diff --git a/dm.c b/dm.c
+index 5daa0e5..d5b84c8 100644
+--- a/dm.c
++++ b/dm.c
+@@ -19,6 +19,7 @@
+ #define _GNU_SOURCE
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <sys/sysmacros.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <stdarg.h>
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix
new file mode 100644
index 000000000000..ddf260300fbc
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, python, lvm2, dmraid }:
+
+stdenv.mkDerivation rec {
+  pname = "pyblock";
+  version = "0.53";
+  md5_path = "f6d33a8362dee358517d0a9e2ebdd044";
+
+  src = fetchurl {
+    url = "https://src.fedoraproject.org/repo/pkgs/python-pyblock/"
+        + "${pname}-${version}.tar.bz2/${md5_path}/${pname}-${version}.tar.bz2";
+    sha256 = "f6cef88969300a6564498557eeea1d8da58acceae238077852ff261a2cb1d815";
+  };
+
+  patches = [
+    # Fix build with glibc >= 2.28
+    # https://github.com/NixOS/nixpkgs/issues/86403
+    ./pyblock-sysmacros.h.patch
+  ];
+
+  postPatch = ''
+    sed -i -e 's|/usr/include/python|${python}/include/python|' \
+           -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile
+  '';
+
+  buildInputs = [ python lvm2 dmraid ];
+
+  makeFlags = [
+    "USESELINUX=0"
+    "SITELIB=$(out)/lib/${python.libPrefix}/site-packages"
+  ];
+
+  meta = with lib; {
+    description = "Interface for working with block devices";
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix
new file mode 100644
index 000000000000..092db8ee7c4c
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix
@@ -0,0 +1,30 @@
+{ lib, python, buildPythonApplication, fetchurl, urlgrabber }:
+
+buildPythonApplication rec {
+  pname = "pykickstart";
+  version = "1.99.39";
+  md5_path = "d249f60aa89b1b4facd63f776925116d";
+
+  src = fetchurl {
+    url = "https://src.fedoraproject.org/repo/pkgs/pykickstart/"
+        + "${pname}-${version}.tar.gz/${md5_path}/${pname}-${version}.tar.gz";
+    sha256 = "e0d0f98ac4c5607e6a48d5c1fba2d50cc804de1081043f9da68cbfc69cad957a";
+  };
+
+  postPatch = ''
+    sed -i -e "s/for tst in tstList/for tst in sorted(tstList, \
+               key=lambda m: m.__name__)/" tests/baseclass.py
+  '';
+
+  propagatedBuildInputs = [ urlgrabber ];
+
+  checkPhase = ''
+    ${python}/bin/${python.executable} tests/baseclass.py -vv
+  '';
+
+  meta = with lib; {
+    homepage = "http://fedoraproject.org/wiki/Pykickstart";
+    description = "Read and write Fedora kickstart files";
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix
new file mode 100644
index 000000000000..9d1eff2bab77
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, pkg-config, python, buildPythonApplication, parted, e2fsprogs }:
+
+buildPythonApplication rec {
+  pname = "pyparted";
+  version = "3.10";
+
+  src = fetchurl {
+    url = "https://fedorahosted.org/releases/p/y/pyparted/${pname}-${version}.tar.gz";
+    sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv";
+  };
+
+  postPatch = ''
+    sed -i -e 's|/sbin/mke2fs|${e2fsprogs}&|' tests/baseclass.py
+    sed -i -e '
+      s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path|
+    ' tests/test__ped_ped.py
+  '' + lib.optionalString stdenv.isi686 ''
+    # remove some integers in this test case which overflow on 32bit systems
+    sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \
+      tests/test__ped_ped.py
+  '';
+
+  preConfigure = ''
+    PATH="${parted}/sbin:$PATH"
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ parted ];
+
+  checkPhase = ''
+    patchShebangs Makefile
+    make test PYTHON=${python.executable}
+  '';
+
+  meta = with lib; {
+    homepage = "https://fedorahosted.org/pyparted/";
+    description = "Python interface for libparted";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix
new file mode 100644
index 000000000000..80ae8ca2b3cd
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchurl, buildPythonApplication, blivet }:
+
+buildPythonApplication rec {
+  pname = "nixpart";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz";
+    sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp";
+  };
+
+  propagatedBuildInputs = [ blivet ];
+
+  meta = {
+    description = "NixOS storage manager/partitioner";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.aszlig ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix b/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix
new file mode 100644
index 000000000000..89ef27827a19
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, pkg-config, mount, libuuid
+, macfuse-stubs, DiskArbitration
+, crypto ? false, libgcrypt, gnutls
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ntfs3g";
+  version = "2017.3.23";
+
+  outputs = [ "out" "dev" "man" "doc" ];
+
+  buildInputs = [ libuuid ] ++ lib.optionals crypto [ gnutls libgcrypt ]
+    ++ lib.optionals stdenv.isDarwin [ macfuse-stubs DiskArbitration ];
+  nativeBuildInputs = [ pkg-config ];
+
+  src = fetchurl {
+    url = "https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz";
+    sha256 = "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy";
+  };
+
+  patchPhase = ''
+    substituteInPlace src/Makefile.in --replace /sbin '@sbindir@'
+    substituteInPlace ntfsprogs/Makefile.in --replace /sbin '@sbindir@'
+    substituteInPlace libfuse-lite/mount_util.c \
+      --replace /bin/mount ${mount}/bin/mount \
+      --replace /bin/umount ${mount}/bin/umount
+  '';
+
+  configureFlags = [
+    "--disable-ldconfig"
+    "--exec-prefix=\${prefix}"
+    "--enable-mount-helper"
+    "--enable-posix-acls"
+    "--enable-xattr-mappings"
+    "--${if crypto then "enable" else "disable"}-crypto"
+    "--enable-extras"
+  ];
+
+  postInstall =
+    ''
+      # Prefer ntfs-3g over the ntfs driver in the kernel.
+      ln -sv mount.ntfs-3g $out/sbin/mount.ntfs
+    '';
+
+  meta = with lib; {
+    homepage = "https://www.tuxera.com/community/open-source-ntfs-3g/";
+    description = "FUSE-based NTFS driver with full write support";
+    maintainers = with maintainers; [ dezgeg ];
+    platforms = with platforms; darwin ++ linux;
+    license = with licenses; [
+      gpl2Plus # ntfs-3g itself
+      lgpl2Plus # fuse-lite
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix b/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix
new file mode 100644
index 000000000000..f6a35437fb92
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchurl, bison, flex, autoreconfHook
+, openssl, db, attr, perl, tcsh
+} :
+
+stdenv.mkDerivation rec {
+  pname = "orangefs";
+  version = "2.9.8";
+
+  src = fetchurl {
+    url = "http://download.orangefs.org/current/source/orangefs-${version}.tar.gz";
+    sha256 = "0c2yla615j04ygclfavh8g5miqhbml2r0zs2c5mvkacf9in7p7sq";
+  };
+
+  nativeBuildInputs = [ bison flex perl autoreconfHook ];
+  buildInputs = [ openssl db attr tcsh ];
+
+  postPatch = ''
+    # Issue introduced by attr-2.4.48
+    substituteInPlace src/apps/user/ofs_setdirhint.c --replace attr/xattr.h sys/xattr.h
+
+    # Do not try to install empty sysconfdir
+    substituteInPlace Makefile.in --replace 'install -d $(sysconfdir)' ""
+
+    # perl interpreter needs to be fixed or build fails
+    patchShebangs ./src/apps/admin/pvfs2-genconfig
+
+    # symlink points to a location in /usr
+    rm ./src/client/webpack/ltmain.sh
+  '';
+
+  configureFlags = [
+    "--sysconfdir=/etc/orangefs"
+    "--enable-shared"
+    "--enable-fast"
+    "--with-ssl=${lib.getDev openssl}"
+  ];
+
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    # install useful helper scripts
+    install examples/keys/pvfs2-gen-keys.sh $out/bin
+  '';
+
+  postFixup = ''
+    for f in pvfs2-getmattr pvfs2-setmattr; do
+      substituteInPlace $out/bin/$f --replace '#!/bin/csh' '#!${tcsh}/bin/tcsh'
+    done
+
+    sed -i 's:openssl:${openssl}/bin/openssl:' $out/bin/pvfs2-gen-keys.sh
+  '';
+
+  meta = with lib; {
+    description = "Scale-out network file system for use on high-end computing systems";
+    homepage = "http://www.orangefs.org/";
+    license = with licenses;  [ asl20 bsd3 gpl2 lgpl21 lgpl21Plus openldap ];
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/rar2fs/default.nix b/nixpkgs/pkgs/tools/filesystems/rar2fs/default.nix
new file mode 100644
index 000000000000..ddd37387fae6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rar2fs/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, fuse
+, unrar
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rar2fs";
+  version = "1.29.4";
+
+  src = fetchFromGitHub {
+    owner = "hasse69";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-O14KuzngzsGazvwz3FCPe0SplO8I6CPJjpCLBPcZq6k=";
+  };
+
+  postPatch = ''
+    substituteInPlace get-version.sh \
+      --replace "which echo" "echo"
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ fuse unrar ];
+
+  configureFlags = [
+    "--with-unrar=${unrar.dev}/include/unrar"
+    "--disable-static-unrar"
+  ];
+
+  meta = with lib; {
+    description = "FUSE file system for reading RAR archives";
+    homepage = "https://hasse69.github.io/rar2fs/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ kraem ];
+    platforms = with platforms; linux ++ freebsd;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix b/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix
new file mode 100644
index 000000000000..08562aed3635
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, nettle }:
+
+stdenv.mkDerivation rec {
+  pname = "rdfind";
+  version = "1.4.1";
+
+  src = fetchurl {
+    url = "https://rdfind.pauldreik.se/${pname}-${version}.tar.gz";
+    sha256 = "132y3wwgnbpdx6f90q0yahd3nkr4cjzcy815ilc8p97b4vn17iih";
+  };
+
+  buildInputs = [ nettle ];
+
+  meta = with lib; {
+    homepage = "https://rdfind.pauldreik.se/";
+    description = "Removes or hardlinks duplicate files very swiftly";
+    license = lib.licenses.gpl2;
+    maintainers = [ maintainers.wmertens ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix b/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix
new file mode 100644
index 000000000000..961a286729a8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, fetchurl, libaal}:
+
+let version = "2.0.4"; in
+stdenv.mkDerivation rec {
+  pname = "reiser4progs";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/reiser4/reiser4-utils/${pname}-${version}.tar.gz";
+    sha256 = "sha256-WmIkISnRp5BngSfPEKY95HVEt5TBtPKu+RMBwlLsnuA=";
+  };
+
+  buildInputs = [libaal];
+
+  hardeningDisable = [ "format" ];
+
+  preConfigure = ''
+    substituteInPlace configure --replace " -static" ""
+  '';
+
+  preInstall = ''
+    substituteInPlace Makefile --replace ./run-ldconfig true
+  '';
+
+  meta = with lib; {
+    inherit version;
+    homepage = "https://sourceforge.net/projects/reiser4/";
+    description = "Reiser4 utilities";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix
new file mode 100644
index 000000000000..dc97cdb652e2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, libuuid, autoreconfHook }:
+
+let version = "3.6.24"; in
+stdenv.mkDerivation rec {
+  pname = "reiserfsprogs";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/v${version}/${pname}-${version}.tar.xz";
+    sha256 = "0q07df9wxxih8714a3mdp61h5n347l7j2a0l351acs3xapzgwi3y";
+  };
+
+  patches = [ ./reiserfsprogs-ar-fix.patch ];
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ libuuid ];
+
+  NIX_CFLAGS_COMPILE = [ "-std=gnu90" "-D_GNU_SOURCE" ];
+
+  meta = {
+    inherit version;
+    homepage = "http://www.namesys.com/";
+    description = "ReiserFS utilities";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch
new file mode 100644
index 000000000000..356782a3d984
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch
@@ -0,0 +1,10 @@
+--- reiserfsprogs-3.6.24/configure.ac.orig	2018-11-29 17:16:52.313624894 +0300
++++ reiserfsprogs-3.6.24/configure.ac	2018-11-29 17:16:54.480669132 +0300
+@@ -21,6 +21,7 @@
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
+ AC_PROG_RANLIB
++AM_PROG_AR
+ 
+ dnl Checks for libraries.
+ 
diff --git a/nixpkgs/pkgs/tools/filesystems/rmfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/rmfuse/default.nix
new file mode 100644
index 000000000000..b7850f7023fe
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmfuse/default.nix
@@ -0,0 +1,26 @@
+{ poetry2nix, pkgs, lib }:
+
+let
+  pythonPackages = (poetry2nix.mkPoetryPackages {
+    projectDir = ./.;
+    overrides = [
+      poetry2nix.defaultPoetryOverrides
+      (import ./poetry-git-overlay.nix { inherit pkgs; })
+      (self: super: {
+
+        rmfuse = super.rmfuse.overridePythonAttrs(old: {
+          meta = old.meta // {
+            description = "RMfuse provides access to your reMarkable Cloud files in the form of a FUSE filesystem.";
+            longDescription = ''
+              RMfuse provides access to your reMarkable Cloud files in the form of a FUSE filesystem. These files are exposed either in their original format, or as PDF files that contain your annotations. This lets you manage files in the reMarkable Cloud using the same tools you use on your local system.
+            '';
+            license = lib.licenses.mit;
+            homepage = "https://github.com/rschroll/rmfuse";
+            maintainers = [ lib.maintainers.adisbladis ];
+          };
+        });
+
+      })
+    ];
+  }).python.pkgs;
+in pythonPackages.rmfuse
diff --git a/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry-git-overlay.nix b/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry-git-overlay.nix
new file mode 100644
index 000000000000..8fa2bc7a0101
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry-git-overlay.nix
@@ -0,0 +1,14 @@
+{ pkgs }:
+self: super: {
+
+  rmfuse = super.rmfuse.overridePythonAttrs (
+    _: {
+      src = pkgs.fetchgit {
+        url = "https://github.com/rschroll/rmfuse.git";
+        rev = "fca03bcdd6dc118f2ba981410ec9dff7f7cb88ec";
+        sha256 = "0i7dvvi2bp3hydjpzvr7vg10bx0wxz87spf7pg455aga8d0qhxgk";
+      };
+    }
+  );
+
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry.lock b/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry.lock
new file mode 100644
index 000000000000..920fbddd0b63
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmfuse/poetry.lock
@@ -0,0 +1,548 @@
+[[package]]
+name = "anyio"
+version = "2.2.0"
+description = "High level compatibility layer for multiple asynchronous event loop implementations"
+category = "main"
+optional = false
+python-versions = ">=3.6.2"
+
+[package.dependencies]
+idna = ">=2.8"
+sniffio = ">=1.1"
+
+[package.extras]
+curio = ["curio (>=1.4)"]
+doc = ["sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"]
+test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=6.0)", "trustme", "uvloop (<0.15)", "uvloop (>=0.15)"]
+trio = ["trio (>=0.16)"]
+
+[[package]]
+name = "asks"
+version = "2.4.12"
+description = "asks - async http"
+category = "main"
+optional = false
+python-versions = ">= 3.6.2"
+
+[package.dependencies]
+anyio = ">=2.0,<3.0"
+async_generator = "*"
+h11 = "*"
+
+[[package]]
+name = "async-generator"
+version = "1.10"
+description = "Async generators and context managers for Python 3.5+"
+category = "main"
+optional = false
+python-versions = ">=3.5"
+
+[[package]]
+name = "attrs"
+version = "20.3.0"
+description = "Classes Without Boilerplate"
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+
+[package.extras]
+dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"]
+docs = ["furo", "sphinx", "zope.interface"]
+tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"]
+tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"]
+
+[[package]]
+name = "bidict"
+version = "0.21.2"
+description = "The bidirectional mapping library for Python."
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.extras]
+coverage = ["coverage (<6)", "pytest-cov (<3)"]
+dev = ["setuptools-scm", "hypothesis (<6)", "py (<2)", "pytest (<7)", "pytest-benchmark (>=3.2.0,<4)", "sortedcollections (<2)", "sortedcontainers (<3)", "Sphinx (<4)", "sphinx-autodoc-typehints (<2)", "coverage (<6)", "pytest-cov (<3)", "pre-commit (<3)", "tox (<4)"]
+docs = ["Sphinx (<4)", "sphinx-autodoc-typehints (<2)"]
+precommit = ["pre-commit (<3)"]
+test = ["hypothesis (<6)", "py (<2)", "pytest (<7)", "pytest-benchmark (>=3.2.0,<4)", "sortedcollections (<2)", "sortedcontainers (<3)", "Sphinx (<4)", "sphinx-autodoc-typehints (<2)"]
+
+[[package]]
+name = "cffi"
+version = "1.14.5"
+description = "Foreign Function Interface for Python calling C code."
+category = "main"
+optional = false
+python-versions = "*"
+
+[package.dependencies]
+pycparser = "*"
+
+[[package]]
+name = "cssselect2"
+version = "0.4.1"
+description = "cssselect2"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+tinycss2 = "*"
+webencodings = "*"
+
+[package.extras]
+doc = ["sphinx", "sphinx-rtd-theme"]
+test = ["pytest", "pytest-cov", "pytest-flake8", "pytest-isort", "coverage"]
+
+[[package]]
+name = "h11"
+version = "0.12.0"
+description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[[package]]
+name = "idna"
+version = "3.1"
+description = "Internationalized Domain Names in Applications (IDNA)"
+category = "main"
+optional = false
+python-versions = ">=3.4"
+
+[[package]]
+name = "lxml"
+version = "4.6.2"
+description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API."
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*"
+
+[package.extras]
+cssselect = ["cssselect (>=0.7)"]
+html5 = ["html5lib"]
+htmlsoup = ["beautifulsoup4"]
+source = ["Cython (>=0.29.7)"]
+
+[[package]]
+name = "outcome"
+version = "1.1.0"
+description = "Capture the outcome of Python function calls."
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+attrs = ">=19.2.0"
+
+[[package]]
+name = "pdfrw"
+version = "0.4"
+description = "PDF file reader/writer library"
+category = "main"
+optional = false
+python-versions = "*"
+
+[[package]]
+name = "pillow"
+version = "8.1.2"
+description = "Python Imaging Library (Fork)"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[[package]]
+name = "pycparser"
+version = "2.20"
+description = "C parser in Python"
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
+
+[[package]]
+name = "pyfuse3"
+version = "3.2.0"
+description = "Python 3 bindings for libfuse 3 with async I/O support"
+category = "main"
+optional = false
+python-versions = ">=3.5"
+
+[package.dependencies]
+trio = ">=0.15"
+
+[[package]]
+name = "reportlab"
+version = "3.5.65"
+description = "The Reportlab Toolkit"
+category = "main"
+optional = false
+python-versions = ">=2.7, >=3.6, <4"
+
+[package.dependencies]
+pillow = ">=4.0.0"
+
+[package.extras]
+rlpycairo = ["rlPyCairo (>=0.0.5)"]
+
+[[package]]
+name = "rmcl"
+version = "0.4.0"
+description = "reMarkable Cloud Library"
+category = "main"
+optional = false
+python-versions = ">=3.7,<4.0"
+
+[package.dependencies]
+asks = ">=2.4.12,<3.0.0"
+trio = ">=0.18.0,<0.19.0"
+xdg = ">=5.0.1,<6.0.0"
+
+[[package]]
+name = "rmfuse"
+version = "0.2.1"
+description = ""
+category = "main"
+optional = false
+python-versions = "^3.7"
+develop = false
+
+[package.dependencies]
+bidict = "^0.21.2"
+pyfuse3 = {version = "^3.2.0", optional = true}
+rmcl = "^0.4.0"
+rmrl = "^0.2.1"
+xdg = "^5.0.1"
+
+[package.extras]
+pyfuse3 = ["pyfuse3 (>=3.2.0,<4.0.0)"]
+llfuse = ["llfuse (>=1.4.1,<2.0.0)"]
+
+[package.source]
+type = "git"
+url = "https://github.com/rschroll/rmfuse.git"
+reference = "master"
+resolved_reference = "fca03bcdd6dc118f2ba981410ec9dff7f7cb88ec"
+
+[[package]]
+name = "rmrl"
+version = "0.2.1"
+description = "Render reMarkable documents to PDF"
+category = "main"
+optional = false
+python-versions = ">=3.7,<4.0"
+
+[package.dependencies]
+pdfrw = ">=0.4,<0.5"
+reportlab = ">=3.5.59,<4.0.0"
+svglib = ">=1.0.1,<2.0.0"
+xdg = ">=5.0.1,<6.0.0"
+
+[[package]]
+name = "sniffio"
+version = "1.2.0"
+description = "Sniff out which async library your code is running under"
+category = "main"
+optional = false
+python-versions = ">=3.5"
+
+[[package]]
+name = "sortedcontainers"
+version = "2.3.0"
+description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set"
+category = "main"
+optional = false
+python-versions = "*"
+
+[[package]]
+name = "svglib"
+version = "1.0.1"
+description = "A pure-Python library for reading and converting SVG"
+category = "main"
+optional = false
+python-versions = ">=3"
+
+[package.dependencies]
+cssselect2 = ">=0.2.0"
+lxml = "*"
+reportlab = "*"
+tinycss2 = ">=0.6.0"
+
+[[package]]
+name = "tinycss2"
+version = "1.1.0"
+description = "tinycss2"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+webencodings = ">=0.4"
+
+[package.extras]
+doc = ["sphinx", "sphinx-rtd-theme"]
+test = ["pytest", "pytest-cov", "pytest-flake8", "pytest-isort", "coverage"]
+
+[[package]]
+name = "trio"
+version = "0.18.0"
+description = "A friendly Python library for async concurrency and I/O"
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+async-generator = ">=1.9"
+attrs = ">=19.2.0"
+cffi = {version = ">=1.14", markers = "os_name == \"nt\" and implementation_name != \"pypy\""}
+idna = "*"
+outcome = "*"
+sniffio = "*"
+sortedcontainers = "*"
+
+[[package]]
+name = "webencodings"
+version = "0.5.1"
+description = "Character encoding aliases for legacy web content"
+category = "main"
+optional = false
+python-versions = "*"
+
+[[package]]
+name = "xdg"
+version = "5.0.1"
+description = "Variables defined by the XDG Base Directory Specification"
+category = "main"
+optional = false
+python-versions = ">=3.6,<4.0"
+
+[metadata]
+lock-version = "1.1"
+python-versions = "^3.8"
+content-hash = "3da90f3013f1220c9081c0a11dac7d8cd05c5a47ebda40fbb4357e44503e99a3"
+
+[metadata.files]
+anyio = [
+    {file = "anyio-2.2.0-py3-none-any.whl", hash = "sha256:aa3da546ed17f097ca876c78024dea380a3b7fa80759abfdda59f12176a3dac8"},
+    {file = "anyio-2.2.0.tar.gz", hash = "sha256:4a41c5b3a65ed92e469d51b6fba3779301850ea2e352afcf9e36c46f21ee14a9"},
+]
+asks = [
+    {file = "asks-2.4.12.tar.gz", hash = "sha256:38de944eb350e7e4e3a918055fa8ff033da5f7b5ff385c1160a2d6b9d84783b0"},
+]
+async-generator = [
+    {file = "async_generator-1.10-py3-none-any.whl", hash = "sha256:01c7bf666359b4967d2cda0000cc2e4af16a0ae098cbffcb8472fb9e8ad6585b"},
+    {file = "async_generator-1.10.tar.gz", hash = "sha256:6ebb3d106c12920aaae42ccb6f787ef5eefdcdd166ea3d628fa8476abe712144"},
+]
+attrs = [
+    {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"},
+    {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"},
+]
+bidict = [
+    {file = "bidict-0.21.2-py2.py3-none-any.whl", hash = "sha256:929d056e8d0d9b17ceda20ba5b24ac388e2a4d39802b87f9f4d3f45ecba070bf"},
+    {file = "bidict-0.21.2.tar.gz", hash = "sha256:4fa46f7ff96dc244abfc437383d987404ae861df797e2fd5b190e233c302be09"},
+]
+cffi = [
+    {file = "cffi-1.14.5-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:bb89f306e5da99f4d922728ddcd6f7fcebb3241fc40edebcb7284d7514741991"},
+    {file = "cffi-1.14.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:34eff4b97f3d982fb93e2831e6750127d1355a923ebaeeb565407b3d2f8d41a1"},
+    {file = "cffi-1.14.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:99cd03ae7988a93dd00bcd9d0b75e1f6c426063d6f03d2f90b89e29b25b82dfa"},
+    {file = "cffi-1.14.5-cp27-cp27m-win32.whl", hash = "sha256:65fa59693c62cf06e45ddbb822165394a288edce9e276647f0046e1ec26920f3"},
+    {file = "cffi-1.14.5-cp27-cp27m-win_amd64.whl", hash = "sha256:51182f8927c5af975fece87b1b369f722c570fe169f9880764b1ee3bca8347b5"},
+    {file = "cffi-1.14.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:43e0b9d9e2c9e5d152946b9c5fe062c151614b262fda2e7b201204de0b99e482"},
+    {file = "cffi-1.14.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:cbde590d4faaa07c72bf979734738f328d239913ba3e043b1e98fe9a39f8b2b6"},
+    {file = "cffi-1.14.5-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:5de7970188bb46b7bf9858eb6890aad302577a5f6f75091fd7cdd3ef13ef3045"},
+    {file = "cffi-1.14.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:a465da611f6fa124963b91bf432d960a555563efe4ed1cc403ba5077b15370aa"},
+    {file = "cffi-1.14.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:d42b11d692e11b6634f7613ad8df5d6d5f8875f5d48939520d351007b3c13406"},
+    {file = "cffi-1.14.5-cp35-cp35m-win32.whl", hash = "sha256:72d8d3ef52c208ee1c7b2e341f7d71c6fd3157138abf1a95166e6165dd5d4369"},
+    {file = "cffi-1.14.5-cp35-cp35m-win_amd64.whl", hash = "sha256:29314480e958fd8aab22e4a58b355b629c59bf5f2ac2492b61e3dc06d8c7a315"},
+    {file = "cffi-1.14.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:3d3dd4c9e559eb172ecf00a2a7517e97d1e96de2a5e610bd9b68cea3925b4892"},
+    {file = "cffi-1.14.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:48e1c69bbacfc3d932221851b39d49e81567a4d4aac3b21258d9c24578280058"},
+    {file = "cffi-1.14.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:69e395c24fc60aad6bb4fa7e583698ea6cc684648e1ffb7fe85e3c1ca131a7d5"},
+    {file = "cffi-1.14.5-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:9e93e79c2551ff263400e1e4be085a1210e12073a31c2011dbbda14bda0c6132"},
+    {file = "cffi-1.14.5-cp36-cp36m-win32.whl", hash = "sha256:58e3f59d583d413809d60779492342801d6e82fefb89c86a38e040c16883be53"},
+    {file = "cffi-1.14.5-cp36-cp36m-win_amd64.whl", hash = "sha256:005a36f41773e148deac64b08f233873a4d0c18b053d37da83f6af4d9087b813"},
+    {file = "cffi-1.14.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2894f2df484ff56d717bead0a5c2abb6b9d2bf26d6960c4604d5c48bbc30ee73"},
+    {file = "cffi-1.14.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:0857f0ae312d855239a55c81ef453ee8fd24136eaba8e87a2eceba644c0d4c06"},
+    {file = "cffi-1.14.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:cd2868886d547469123fadc46eac7ea5253ea7fcb139f12e1dfc2bbd406427d1"},
+    {file = "cffi-1.14.5-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:35f27e6eb43380fa080dccf676dece30bef72e4a67617ffda586641cd4508d49"},
+    {file = "cffi-1.14.5-cp37-cp37m-win32.whl", hash = "sha256:9ff227395193126d82e60319a673a037d5de84633f11279e336f9c0f189ecc62"},
+    {file = "cffi-1.14.5-cp37-cp37m-win_amd64.whl", hash = "sha256:9cf8022fb8d07a97c178b02327b284521c7708d7c71a9c9c355c178ac4bbd3d4"},
+    {file = "cffi-1.14.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8b198cec6c72df5289c05b05b8b0969819783f9418e0409865dac47288d2a053"},
+    {file = "cffi-1.14.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:ad17025d226ee5beec591b52800c11680fca3df50b8b29fe51d882576e039ee0"},
+    {file = "cffi-1.14.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:6c97d7350133666fbb5cf4abdc1178c812cb205dc6f41d174a7b0f18fb93337e"},
+    {file = "cffi-1.14.5-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:8ae6299f6c68de06f136f1f9e69458eae58f1dacf10af5c17353eae03aa0d827"},
+    {file = "cffi-1.14.5-cp38-cp38-win32.whl", hash = "sha256:b85eb46a81787c50650f2392b9b4ef23e1f126313b9e0e9013b35c15e4288e2e"},
+    {file = "cffi-1.14.5-cp38-cp38-win_amd64.whl", hash = "sha256:1f436816fc868b098b0d63b8920de7d208c90a67212546d02f84fe78a9c26396"},
+    {file = "cffi-1.14.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1071534bbbf8cbb31b498d5d9db0f274f2f7a865adca4ae429e147ba40f73dea"},
+    {file = "cffi-1.14.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:9de2e279153a443c656f2defd67769e6d1e4163952b3c622dcea5b08a6405322"},
+    {file = "cffi-1.14.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:6e4714cc64f474e4d6e37cfff31a814b509a35cb17de4fb1999907575684479c"},
+    {file = "cffi-1.14.5-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:158d0d15119b4b7ff6b926536763dc0714313aa59e320ddf787502c70c4d4bee"},
+    {file = "cffi-1.14.5-cp39-cp39-win32.whl", hash = "sha256:afb29c1ba2e5a3736f1c301d9d0abe3ec8b86957d04ddfa9d7a6a42b9367e396"},
+    {file = "cffi-1.14.5-cp39-cp39-win_amd64.whl", hash = "sha256:f2d45f97ab6bb54753eab54fffe75aaf3de4ff2341c9daee1987ee1837636f1d"},
+    {file = "cffi-1.14.5.tar.gz", hash = "sha256:fd78e5fee591709f32ef6edb9a015b4aa1a5022598e36227500c8f4e02328d9c"},
+]
+cssselect2 = [
+    {file = "cssselect2-0.4.1-py3-none-any.whl", hash = "sha256:2f4a9f20965367bae459e3bb42561f7927e0cfe5b7ea1692757cf67ef5d7dace"},
+    {file = "cssselect2-0.4.1.tar.gz", hash = "sha256:93fbb9af860e95dd40bf18c3b2b6ed99189a07c0f29ba76f9c5be71344664ec8"},
+]
+h11 = [
+    {file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"},
+    {file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"},
+]
+idna = [
+    {file = "idna-3.1-py3-none-any.whl", hash = "sha256:5205d03e7bcbb919cc9c19885f9920d622ca52448306f2377daede5cf3faac16"},
+    {file = "idna-3.1.tar.gz", hash = "sha256:c5b02147e01ea9920e6b0a3f1f7bb833612d507592c837a6c49552768f4054e1"},
+]
+lxml = [
+    {file = "lxml-4.6.2-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:a9d6bc8642e2c67db33f1247a77c53476f3a166e09067c0474facb045756087f"},
+    {file = "lxml-4.6.2-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:791394449e98243839fa822a637177dd42a95f4883ad3dec2a0ce6ac99fb0a9d"},
+    {file = "lxml-4.6.2-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:68a5d77e440df94011214b7db907ec8f19e439507a70c958f750c18d88f995d2"},
+    {file = "lxml-4.6.2-cp27-cp27m-win32.whl", hash = "sha256:fc37870d6716b137e80d19241d0e2cff7a7643b925dfa49b4c8ebd1295eb506e"},
+    {file = "lxml-4.6.2-cp27-cp27m-win_amd64.whl", hash = "sha256:69a63f83e88138ab7642d8f61418cf3180a4d8cd13995df87725cb8b893e950e"},
+    {file = "lxml-4.6.2-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:42ebca24ba2a21065fb546f3e6bd0c58c3fe9ac298f3a320147029a4850f51a2"},
+    {file = "lxml-4.6.2-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:f83d281bb2a6217cd806f4cf0ddded436790e66f393e124dfe9731f6b3fb9afe"},
+    {file = "lxml-4.6.2-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:535f067002b0fd1a4e5296a8f1bf88193080ff992a195e66964ef2a6cfec5388"},
+    {file = "lxml-4.6.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:366cb750140f221523fa062d641393092813b81e15d0e25d9f7c6025f910ee80"},
+    {file = "lxml-4.6.2-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:97db258793d193c7b62d4e2586c6ed98d51086e93f9a3af2b2034af01450a74b"},
+    {file = "lxml-4.6.2-cp35-cp35m-win32.whl", hash = "sha256:648914abafe67f11be7d93c1a546068f8eff3c5fa938e1f94509e4a5d682b2d8"},
+    {file = "lxml-4.6.2-cp35-cp35m-win_amd64.whl", hash = "sha256:4e751e77006da34643ab782e4a5cc21ea7b755551db202bc4d3a423b307db780"},
+    {file = "lxml-4.6.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:681d75e1a38a69f1e64ab82fe4b1ed3fd758717bed735fb9aeaa124143f051af"},
+    {file = "lxml-4.6.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:127f76864468d6630e1b453d3ffbbd04b024c674f55cf0a30dc2595137892d37"},
+    {file = "lxml-4.6.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4fb85c447e288df535b17ebdebf0ec1cf3a3f1a8eba7e79169f4f37af43c6b98"},
+    {file = "lxml-4.6.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:5be4a2e212bb6aa045e37f7d48e3e1e4b6fd259882ed5a00786f82e8c37ce77d"},
+    {file = "lxml-4.6.2-cp36-cp36m-win32.whl", hash = "sha256:8c88b599e226994ad4db29d93bc149aa1aff3dc3a4355dd5757569ba78632bdf"},
+    {file = "lxml-4.6.2-cp36-cp36m-win_amd64.whl", hash = "sha256:6e4183800f16f3679076dfa8abf2db3083919d7e30764a069fb66b2b9eff9939"},
+    {file = "lxml-4.6.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:d8d3d4713f0c28bdc6c806a278d998546e8efc3498949e3ace6e117462ac0a5e"},
+    {file = "lxml-4.6.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:8246f30ca34dc712ab07e51dc34fea883c00b7ccb0e614651e49da2c49a30711"},
+    {file = "lxml-4.6.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:923963e989ffbceaa210ac37afc9b906acebe945d2723e9679b643513837b089"},
+    {file = "lxml-4.6.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:1471cee35eba321827d7d53d104e7b8c593ea3ad376aa2df89533ce8e1b24a01"},
+    {file = "lxml-4.6.2-cp37-cp37m-win32.whl", hash = "sha256:2363c35637d2d9d6f26f60a208819e7eafc4305ce39dc1d5005eccc4593331c2"},
+    {file = "lxml-4.6.2-cp37-cp37m-win_amd64.whl", hash = "sha256:f4822c0660c3754f1a41a655e37cb4dbbc9be3d35b125a37fab6f82d47674ebc"},
+    {file = "lxml-4.6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0448576c148c129594d890265b1a83b9cd76fd1f0a6a04620753d9a6bcfd0a4d"},
+    {file = "lxml-4.6.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:60a20bfc3bd234d54d49c388950195d23a5583d4108e1a1d47c9eef8d8c042b3"},
+    {file = "lxml-4.6.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2e5cc908fe43fe1aa299e58046ad66981131a66aea3129aac7770c37f590a644"},
+    {file = "lxml-4.6.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:50c348995b47b5a4e330362cf39fc503b4a43b14a91c34c83b955e1805c8e308"},
+    {file = "lxml-4.6.2-cp38-cp38-win32.whl", hash = "sha256:94d55bd03d8671686e3f012577d9caa5421a07286dd351dfef64791cf7c6c505"},
+    {file = "lxml-4.6.2-cp38-cp38-win_amd64.whl", hash = "sha256:7a7669ff50f41225ca5d6ee0a1ec8413f3a0d8aa2b109f86d540887b7ec0d72a"},
+    {file = "lxml-4.6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e0bfe9bb028974a481410432dbe1b182e8191d5d40382e5b8ff39cdd2e5c5931"},
+    {file = "lxml-4.6.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:6fd8d5903c2e53f49e99359b063df27fdf7acb89a52b6a12494208bf61345a03"},
+    {file = "lxml-4.6.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:7e9eac1e526386df7c70ef253b792a0a12dd86d833b1d329e038c7a235dfceb5"},
+    {file = "lxml-4.6.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:7ee8af0b9f7de635c61cdd5b8534b76c52cd03536f29f51151b377f76e214a1a"},
+    {file = "lxml-4.6.2-cp39-cp39-win32.whl", hash = "sha256:2e6fd1b8acd005bd71e6c94f30c055594bbd0aa02ef51a22bbfa961ab63b2d75"},
+    {file = "lxml-4.6.2-cp39-cp39-win_amd64.whl", hash = "sha256:535332fe9d00c3cd455bd3dd7d4bacab86e2d564bdf7606079160fa6251caacf"},
+    {file = "lxml-4.6.2.tar.gz", hash = "sha256:cd11c7e8d21af997ee8079037fff88f16fda188a9776eb4b81c7e4c9c0a7d7fc"},
+]
+outcome = [
+    {file = "outcome-1.1.0-py2.py3-none-any.whl", hash = "sha256:c7dd9375cfd3c12db9801d080a3b63d4b0a261aa996c4c13152380587288d958"},
+    {file = "outcome-1.1.0.tar.gz", hash = "sha256:e862f01d4e626e63e8f92c38d1f8d5546d3f9cce989263c521b2e7990d186967"},
+]
+pdfrw = [
+    {file = "pdfrw-0.4-py2.py3-none-any.whl", hash = "sha256:758289edaa3b672e9a1a67504be73c18ec668d4e5b9d5ac9cbc0dc753d8d196b"},
+    {file = "pdfrw-0.4.tar.gz", hash = "sha256:0dc0494a0e6561b268542b28ede2280387c2728114f117d3bb5d8e4787b93ef4"},
+]
+pillow = [
+    {file = "Pillow-8.1.2-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:5cf03b9534aca63b192856aa601c68d0764810857786ea5da652581f3a44c2b0"},
+    {file = "Pillow-8.1.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:f91b50ad88048d795c0ad004abbe1390aa1882073b1dca10bfd55d0b8cf18ec5"},
+    {file = "Pillow-8.1.2-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5762ebb4436f46b566fc6351d67a9b5386b5e5de4e58fdaa18a1c83e0e20f1a8"},
+    {file = "Pillow-8.1.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:e2cd8ac157c1e5ae88b6dd790648ee5d2777e76f1e5c7d184eaddb2938594f34"},
+    {file = "Pillow-8.1.2-cp36-cp36m-win32.whl", hash = "sha256:72027ebf682abc9bafd93b43edc44279f641e8996fb2945104471419113cfc71"},
+    {file = "Pillow-8.1.2-cp36-cp36m-win_amd64.whl", hash = "sha256:d1d6bca39bb6dd94fba23cdb3eeaea5e30c7717c5343004d900e2a63b132c341"},
+    {file = "Pillow-8.1.2-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:90882c6f084ef68b71bba190209a734bf90abb82ab5e8f64444c71d5974008c6"},
+    {file = "Pillow-8.1.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:89e4c757a91b8c55d97c91fa09c69b3677c227b942fa749e9a66eef602f59c28"},
+    {file = "Pillow-8.1.2-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:8c4e32218c764bc27fe49b7328195579581aa419920edcc321c4cb877c65258d"},
+    {file = "Pillow-8.1.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:a01da2c266d9868c4f91a9c6faf47a251f23b9a862dce81d2ff583135206f5be"},
+    {file = "Pillow-8.1.2-cp37-cp37m-win32.whl", hash = "sha256:30d33a1a6400132e6f521640dd3f64578ac9bfb79a619416d7e8802b4ce1dd55"},
+    {file = "Pillow-8.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:71b01ee69e7df527439d7752a2ce8fb89e19a32df484a308eca3e81f673d3a03"},
+    {file = "Pillow-8.1.2-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:5a2d957eb4aba9d48170b8fe6538ec1fbc2119ffe6373782c03d8acad3323f2e"},
+    {file = "Pillow-8.1.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:87f42c976f91ca2fc21a3293e25bd3cd895918597db1b95b93cbd949f7d019ce"},
+    {file = "Pillow-8.1.2-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:15306d71a1e96d7e271fd2a0737038b5a92ca2978d2e38b6ced7966583e3d5af"},
+    {file = "Pillow-8.1.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:71f31ee4df3d5e0b366dd362007740106d3210fb6a56ec4b581a5324ba254f06"},
+    {file = "Pillow-8.1.2-cp38-cp38-win32.whl", hash = "sha256:98afcac3205d31ab6a10c5006b0cf040d0026a68ec051edd3517b776c1d78b09"},
+    {file = "Pillow-8.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:328240f7dddf77783e72d5ed79899a6b48bc6681f8d1f6001f55933cb4905060"},
+    {file = "Pillow-8.1.2-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:bead24c0ae3f1f6afcb915a057943ccf65fc755d11a1410a909c1fefb6c06ad1"},
+    {file = "Pillow-8.1.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:81b3716cc9744ffdf76b39afb6247eae754186838cedad0b0ac63b2571253fe6"},
+    {file = "Pillow-8.1.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:63cd413ac52ee3f67057223d363f4f82ce966e64906aea046daf46695e3c8238"},
+    {file = "Pillow-8.1.2-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:8565355a29655b28fdc2c666fd9a3890fe5edc6639d128814fafecfae2d70910"},
+    {file = "Pillow-8.1.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:1940fc4d361f9cc7e558d6f56ff38d7351b53052fd7911f4b60cd7bc091ea3b1"},
+    {file = "Pillow-8.1.2-cp39-cp39-win32.whl", hash = "sha256:46c2bcf8e1e75d154e78417b3e3c64e96def738c2a25435e74909e127a8cba5e"},
+    {file = "Pillow-8.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:aeab4cd016e11e7aa5cfc49dcff8e51561fa64818a0be86efa82c7038e9369d0"},
+    {file = "Pillow-8.1.2-pp36-pypy36_pp73-macosx_10_10_x86_64.whl", hash = "sha256:74cd9aa648ed6dd25e572453eb09b08817a1e3d9f8d1bd4d8403d99e42ea790b"},
+    {file = "Pillow-8.1.2-pp36-pypy36_pp73-manylinux2010_i686.whl", hash = "sha256:e5739ae63636a52b706a0facec77b2b58e485637e1638202556156e424a02dc2"},
+    {file = "Pillow-8.1.2-pp36-pypy36_pp73-manylinux2010_x86_64.whl", hash = "sha256:903293320efe2466c1ab3509a33d6b866dc850cfd0c5d9cc92632014cec185fb"},
+    {file = "Pillow-8.1.2-pp37-pypy37_pp73-macosx_10_10_x86_64.whl", hash = "sha256:5daba2b40782c1c5157a788ec4454067c6616f5a0c1b70e26ac326a880c2d328"},
+    {file = "Pillow-8.1.2-pp37-pypy37_pp73-manylinux2010_i686.whl", hash = "sha256:1f93f2fe211f1ef75e6f589327f4d4f8545d5c8e826231b042b483d8383e8a7c"},
+    {file = "Pillow-8.1.2-pp37-pypy37_pp73-manylinux2010_x86_64.whl", hash = "sha256:6efac40344d8f668b6c4533ae02a48d52fd852ef0654cc6f19f6ac146399c733"},
+    {file = "Pillow-8.1.2-pp37-pypy37_pp73-win32.whl", hash = "sha256:f36c3ff63d6fc509ce599a2f5b0d0732189eed653420e7294c039d342c6e204a"},
+    {file = "Pillow-8.1.2.tar.gz", hash = "sha256:b07c660e014852d98a00a91adfbe25033898a9d90a8f39beb2437d22a203fc44"},
+]
+pycparser = [
+    {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"},
+    {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"},
+]
+pyfuse3 = [
+    {file = "pyfuse3-3.2.0.tar.gz", hash = "sha256:45f0053ad601b03a36e2c283a5271403674245a66a0daf50e3deaab0ea4fa82f"},
+]
+reportlab = [
+    {file = "reportlab-3.5.65-cp36-cp36m-macosx_10_10_x86_64.whl", hash = "sha256:fd6712a8a6dca12181a3a12316f97810927861e77f2a98029efd2c5cfc8546dc"},
+    {file = "reportlab-3.5.65-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:ee711804acdaf3ea7f0f2cd27f19478af993e730df8c8d923a678eb0e2572fba"},
+    {file = "reportlab-3.5.65-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4c42e85851f969e21fa4d6414587b7544e877ce685e2495d7d422589c70b6281"},
+    {file = "reportlab-3.5.65-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:d8fefd07072bfae2715283a821fb1acf8fc4946cf925509d5cc2af791c611809"},
+    {file = "reportlab-3.5.65-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:bdf751289efee4891f4f354ce9122da8de8258a40f328b3f11540c4888363337"},
+    {file = "reportlab-3.5.65-cp36-cp36m-win32.whl", hash = "sha256:f0634740b099b69caed081acd89692996b5504c59f86f39781b6bebc82b267f5"},
+    {file = "reportlab-3.5.65-cp36-cp36m-win_amd64.whl", hash = "sha256:d810bffd4bcd50fdcb2bab0d1fe9ea4e6187ed5237687e41c6ade6c884b00c1e"},
+    {file = "reportlab-3.5.65-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:46745826657d35f86843487f4bc6f6f805f61260428f8ee13642bf6372f9df55"},
+    {file = "reportlab-3.5.65-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:bc62187181582772688d65c557ad6a40a4c3bb8d1f74de463d35ea81983e9b75"},
+    {file = "reportlab-3.5.65-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:58bec163f727c1c60515fc4704a961b3b4ccf2c76b4e6ec1a457ea7ed0c2d756"},
+    {file = "reportlab-3.5.65-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:d92834993bf998853a04946729266a3276965e7b13f7423212f1c1abdfc4a1c7"},
+    {file = "reportlab-3.5.65-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:9ec95808b742ce70c1dab28b2c5bef9093816b92315b948419c2c6968658f9cc"},
+    {file = "reportlab-3.5.65-cp37-cp37m-win32.whl", hash = "sha256:b9494986f35d82350b0ce0c29704a49a3945421b789dff92e93fbd3de554fa34"},
+    {file = "reportlab-3.5.65-cp37-cp37m-win_amd64.whl", hash = "sha256:07f9d9c0360cb8fc780ca05264faa68b90583cd28dbdf2cda6bda34379b6e66c"},
+    {file = "reportlab-3.5.65-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:81898de0a0be2c8318468ae0ae1590f828805e9b7fd68e5a50667dce8b942171"},
+    {file = "reportlab-3.5.65-cp38-cp38-manylinux1_i686.whl", hash = "sha256:99aeee49a61c85f1af1087e9e418f3d0c2352c4dd0f0abbfac17ae6c467185aa"},
+    {file = "reportlab-3.5.65-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:3ec70873d99c14570e2a9c44b86c8c01526871e7af5ee4b2855246db15cb0c9f"},
+    {file = "reportlab-3.5.65-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:c12432575c793b8cd8552fddc219bbf2813541c64d02854ae345a108fb875b9d"},
+    {file = "reportlab-3.5.65-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:b2cf692ae7af995b499a31a3f58f2001d98e310e03f74812bcb97a08078239c0"},
+    {file = "reportlab-3.5.65-cp38-cp38-win32.whl", hash = "sha256:f92388e30bf6b5d2eceb3d7b05ee2df856635f74ce7d950a8f45d2b70c685a5b"},
+    {file = "reportlab-3.5.65-cp38-cp38-win_amd64.whl", hash = "sha256:6f007142f2b166f52cbb3e5d23319e3e496c429831e53b904e6db28c3370f279"},
+    {file = "reportlab-3.5.65-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:8707cc21a769150154bf4634dca6e9581ae24a05f0fb81a84fcc1143b1cbbfde"},
+    {file = "reportlab-3.5.65-cp39-cp39-manylinux1_i686.whl", hash = "sha256:27a831da0d17153e33c985bd7a88307e206c5a28778cddb755d5372598d12637"},
+    {file = "reportlab-3.5.65-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fe5d98cdac07dd702bcd49f5723aacdd0af8c84d70fc82a5cc3781e52aedad52"},
+    {file = "reportlab-3.5.65-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:ba2d10f368c9ea1e76c84b3bb6b9982eb5a8f243c434e821c505b75ca8d85852"},
+    {file = "reportlab-3.5.65-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:289539f7888239343ef7ebcd30c55e6204ef78d5f70e1547fdeb854a2da8bfa1"},
+    {file = "reportlab-3.5.65-cp39-cp39-win32.whl", hash = "sha256:cdf8ff72cd6fa9303744c8409fb81ef7720da2e034c369762c2fdf496462179e"},
+    {file = "reportlab-3.5.65-cp39-cp39-win_amd64.whl", hash = "sha256:4a784ecdf3008f533e5a032b96c395e8592ed5e679baaf5ef4dcc136b01c72e9"},
+    {file = "reportlab-3.5.65.tar.gz", hash = "sha256:b2c7eedb4d19db63301c27ad1076086a099fd4c8ca0a6f62f6e9ed749fa5908f"},
+]
+rmcl = [
+    {file = "rmcl-0.4.0-py3-none-any.whl", hash = "sha256:d2fc5d183b213797f5886a6af52c5531c87b4e1770cc720e0e8ba5992e728473"},
+    {file = "rmcl-0.4.0.tar.gz", hash = "sha256:14bd199ff2c71269c3c1ac63d10932de6c68a250a454550940dae3f06b07527a"},
+]
+rmfuse = []
+rmrl = [
+    {file = "rmrl-0.2.1-py3-none-any.whl", hash = "sha256:c35b9f20494a6034a16e916d7351575efb3e3f77acabe9094453a7f6013eaa86"},
+    {file = "rmrl-0.2.1.tar.gz", hash = "sha256:c532bef4168350e6ab17cf37c6481dc12b6a78e007c073503f082f36215b71c9"},
+]
+sniffio = [
+    {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"},
+    {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"},
+]
+sortedcontainers = [
+    {file = "sortedcontainers-2.3.0-py2.py3-none-any.whl", hash = "sha256:37257a32add0a3ee490bb170b599e93095eed89a55da91fa9f48753ea12fd73f"},
+    {file = "sortedcontainers-2.3.0.tar.gz", hash = "sha256:59cc937650cf60d677c16775597c89a960658a09cf7c1a668f86e1e4464b10a1"},
+]
+svglib = [
+    {file = "svglib-1.0.1.tar.gz", hash = "sha256:ff01593e8c07ea462d3742e1f4141bfa261cbd4400ceb25dfb8fec3508ad0e50"},
+]
+tinycss2 = [
+    {file = "tinycss2-1.1.0-py3-none-any.whl", hash = "sha256:0353b5234bcaee7b1ac7ca3dea7e02cd338a9f8dcbb8f2dcd32a5795ec1e5f9a"},
+    {file = "tinycss2-1.1.0.tar.gz", hash = "sha256:fbdcac3044d60eb85fdb2aa840ece43cf7dbe798e373e6ee0be545d4d134e18a"},
+]
+trio = [
+    {file = "trio-0.18.0-py3-none-any.whl", hash = "sha256:a42af0634ba729cbfe8578be058750c6471dac19fbc7167ec6a3ca3f966fb424"},
+    {file = "trio-0.18.0.tar.gz", hash = "sha256:87a66ae61f27fe500c9024926a9ba482c07e1e0f56380b70a264d19c435ba076"},
+]
+webencodings = [
+    {file = "webencodings-0.5.1-py2.py3-none-any.whl", hash = "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78"},
+    {file = "webencodings-0.5.1.tar.gz", hash = "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"},
+]
+xdg = [
+    {file = "xdg-5.0.1-py3-none-any.whl", hash = "sha256:9ddd6649bee9148f952305603a08474e3ef37c909eb19dfcb9737d54ebcc407e"},
+    {file = "xdg-5.0.1.tar.gz", hash = "sha256:97a27058caa61b4ce04e05471643caa6bc8c563d2638f92c0516ac50208146d8"},
+]
diff --git a/nixpkgs/pkgs/tools/filesystems/rmfuse/pyproject.toml b/nixpkgs/pkgs/tools/filesystems/rmfuse/pyproject.toml
new file mode 100644
index 000000000000..e3f1767b4cfa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmfuse/pyproject.toml
@@ -0,0 +1,15 @@
+[tool.poetry]
+name = "rmfuse-env"
+version = "0.1.0"
+description = ""
+authors = []
+
+[tool.poetry.dependencies]
+python = "^3.8"
+rmfuse = {git = "https://github.com/rschroll/rmfuse.git", extras = ["pyfuse3"]}
+
+[tool.poetry.dev-dependencies]
+
+[build-system]
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
diff --git a/nixpkgs/pkgs/tools/filesystems/rmfuse/update b/nixpkgs/pkgs/tools/filesystems/rmfuse/update
new file mode 100755
index 000000000000..77cfe9ff86d9
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmfuse/update
@@ -0,0 +1,5 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p poetry poetry2nix.cli
+set -eu
+poetry lock
+poetry2nix lock
diff --git a/nixpkgs/pkgs/tools/filesystems/rmount/default.nix b/nixpkgs/pkgs/tools/filesystems/rmount/default.nix
new file mode 100644
index 000000000000..1d8ced17aae0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/rmount/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, nmap, jq, cifs-utils, sshfs, fetchFromGitHub, makeWrapper }:
+
+stdenv.mkDerivation rec {
+
+  pname   = "rmount";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    rev = "v${version}";
+    owner = "Luis-Hebendanz";
+    repo = "rmount";
+    sha256 = "0j1ayncw1nnmgna7vyx44vwinh4ah1b0l5y8agc7i4s8clbvy3h0";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    install -D ${src}/rmount.man  $out/share/man/man1/rmount.1
+    install -D ${src}/rmount.bash $out/bin/rmount
+    install -D ${src}/config.json $out/share/config.json
+
+    wrapProgram $out/bin/rmount --prefix PATH : ${lib.makeBinPath [ nmap jq cifs-utils sshfs ]}
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/Luis-Hebendanz/rmount";
+    description = "Remote mount utility which parses a json file";
+    license = licenses.mit;
+    maintainers = [ maintainers.luis ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/romdirfs/default.nix b/nixpkgs/pkgs/tools/filesystems/romdirfs/default.nix
new file mode 100644
index 000000000000..0304508d41eb
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/romdirfs/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "romdirfs";
+  version = "1.2";
+
+  src = fetchFromGitHub {
+    owner = "mlafeldt";
+    repo = "romdirfs";
+    rev = "v${version}";
+    sha256 = "1jbsmpklrycz5q86qmzvbz4iz2g5fvd7p9nca160aw2izwpws0g7";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ fuse ];
+
+  meta = with lib; {
+    description = "FUSE for access Playstation 2 IOP IOPRP images and BIOS dumps";
+    homepage = "https://github.com/mlafeldt/romdirfs";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix b/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix
new file mode 100644
index 000000000000..b196b2948395
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, fuse, curl, expat }:
+
+stdenv.mkDerivation rec {
+  pname = "s3backer";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    sha256 = "sha256-67sVT72i8tOMdGH/+Oh1N7Vh/2/qD56ImGWI+tprMOM=";
+    rev = version;
+    repo = "s3backer";
+    owner = "archiecobbs";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ fuse curl expat ];
+
+  # AC_CHECK_DECLS doesn't work with clang
+  postPatch = lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace configure.ac --replace \
+      'AC_CHECK_DECLS(fdatasync)' ""
+  '';
+
+  autoreconfPhase = ''
+    patchShebangs ./autogen.sh
+    ./autogen.sh
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/archiecobbs/s3backer";
+    description = "FUSE-based single file backing store via Amazon S3";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix b/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix
new file mode 100644
index 000000000000..95b5b6ab34aa
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, curl, openssl, libxml2, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "s3fs-fuse";
+  version = "1.89";
+
+  src = fetchFromGitHub {
+    owner  = "s3fs-fuse";
+    repo   = "s3fs-fuse";
+    rev    = "v${version}";
+    sha256 = "sha256-Agb0tq7B98Ioe0G/XEZCYcFQKnMuYXX9x0yg4Gvu3/k=";
+  };
+
+  buildInputs = [ curl openssl libxml2 fuse ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  configureFlags = [
+    "--with-openssl"
+  ];
+
+  postInstall = ''
+    ln -s $out/bin/s3fs $out/bin/mount.s3fs
+  '';
+
+  meta = with lib; {
+    description = "Mount an S3 bucket as filesystem through FUSE";
+    license = licenses.gpl2;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/sandboxfs/Cargo.lock.patch b/nixpkgs/pkgs/tools/filesystems/sandboxfs/Cargo.lock.patch
new file mode 100644
index 000000000000..fbc4c80872cf
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sandboxfs/Cargo.lock.patch
@@ -0,0 +1,640 @@
+diff --git a/Cargo.lock b/Cargo.lock
+new file mode 100644
+index 0000000..5e16611
+--- /dev/null
++++ b/Cargo.lock
+@@ -0,0 +1,634 @@
++# This file is automatically @generated by Cargo.
++# It is not intended for manual editing.
++[[package]]
++name = "addr2line"
++version = "0.13.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072"
++dependencies = [
++ "gimli",
++]
++
++[[package]]
++name = "adler"
++version = "0.2.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
++
++[[package]]
++name = "aho-corasick"
++version = "0.7.13"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
++dependencies = [
++ "memchr",
++]
++
++[[package]]
++name = "arc-swap"
++version = "0.4.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
++
++[[package]]
++name = "atty"
++version = "0.2.14"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
++dependencies = [
++ "hermit-abi",
++ "libc",
++ "winapi",
++]
++
++[[package]]
++name = "autocfg"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
++
++[[package]]
++name = "backtrace"
++version = "0.3.51"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ec1931848a574faa8f7c71a12ea00453ff5effbb5f51afe7f77d7a48cace6ac1"
++dependencies = [
++ "addr2line",
++ "cfg-if",
++ "libc",
++ "miniz_oxide",
++ "object",
++ "rustc-demangle",
++]
++
++[[package]]
++name = "bitflags"
++version = "1.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
++
++[[package]]
++name = "cc"
++version = "1.0.60"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c"
++
++[[package]]
++name = "cfg-if"
++version = "0.1.10"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
++
++[[package]]
++name = "cpuprofiler"
++version = "0.0.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "43f8479dbcfd2bbaa0c0c26779b913052b375981cdf533091f2127ea3d42e52b"
++dependencies = [
++ "error-chain",
++ "lazy_static",
++ "pkg-config",
++]
++
++[[package]]
++name = "env_logger"
++version = "0.5.13"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
++dependencies = [
++ "atty",
++ "humantime",
++ "log 0.4.11",
++ "regex",
++ "termcolor",
++]
++
++[[package]]
++name = "error-chain"
++version = "0.12.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc"
++dependencies = [
++ "backtrace",
++ "version_check",
++]
++
++[[package]]
++name = "failure"
++version = "0.1.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
++dependencies = [
++ "backtrace",
++ "failure_derive",
++]
++
++[[package]]
++name = "failure_derive"
++version = "0.1.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++ "synstructure",
++]
++
++[[package]]
++name = "fuse"
++version = "0.3.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "80e57070510966bfef93662a81cb8aa2b1c7db0964354fa9921434f04b9e8660"
++dependencies = [
++ "libc",
++ "log 0.3.9",
++ "pkg-config",
++ "thread-scoped",
++ "time",
++]
++
++[[package]]
++name = "getopts"
++version = "0.2.21"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
++dependencies = [
++ "unicode-width",
++]
++
++[[package]]
++name = "getrandom"
++version = "0.1.15"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
++dependencies = [
++ "cfg-if",
++ "libc",
++ "wasi 0.9.0+wasi-snapshot-preview1",
++]
++
++[[package]]
++name = "gimli"
++version = "0.22.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724"
++
++[[package]]
++name = "hermit-abi"
++version = "0.1.16"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151"
++dependencies = [
++ "libc",
++]
++
++[[package]]
++name = "humantime"
++version = "1.3.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
++dependencies = [
++ "quick-error",
++]
++
++[[package]]
++name = "itoa"
++version = "0.4.6"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
++
++[[package]]
++name = "lazy_static"
++version = "1.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
++
++[[package]]
++name = "libc"
++version = "0.2.78"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "aa7087f49d294270db4e1928fc110c976cd4b9e5a16348e0a1df09afa99e6c98"
++
++[[package]]
++name = "log"
++version = "0.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
++dependencies = [
++ "log 0.4.11",
++]
++
++[[package]]
++name = "log"
++version = "0.4.11"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
++dependencies = [
++ "cfg-if",
++]
++
++[[package]]
++name = "memchr"
++version = "2.3.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
++
++[[package]]
++name = "miniz_oxide"
++version = "0.4.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9"
++dependencies = [
++ "adler",
++ "autocfg",
++]
++
++[[package]]
++name = "nix"
++version = "0.12.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "319fffb13b63c0f4ff5a4e1c97566e7e741561ff5d03bf8bbf11653454bbd70b"
++dependencies = [
++ "bitflags",
++ "cc",
++ "cfg-if",
++ "libc",
++ "void",
++]
++
++[[package]]
++name = "num_cpus"
++version = "1.13.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
++dependencies = [
++ "hermit-abi",
++ "libc",
++]
++
++[[package]]
++name = "object"
++version = "0.20.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
++
++[[package]]
++name = "pkg-config"
++version = "0.3.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
++
++[[package]]
++name = "ppv-lite86"
++version = "0.2.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20"
++
++[[package]]
++name = "proc-macro2"
++version = "1.0.24"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
++dependencies = [
++ "unicode-xid",
++]
++
++[[package]]
++name = "quick-error"
++version = "1.2.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
++
++[[package]]
++name = "quote"
++version = "1.0.7"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
++dependencies = [
++ "proc-macro2",
++]
++
++[[package]]
++name = "rand"
++version = "0.7.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
++dependencies = [
++ "getrandom",
++ "libc",
++ "rand_chacha",
++ "rand_core",
++ "rand_hc",
++]
++
++[[package]]
++name = "rand_chacha"
++version = "0.2.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
++dependencies = [
++ "ppv-lite86",
++ "rand_core",
++]
++
++[[package]]
++name = "rand_core"
++version = "0.5.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
++dependencies = [
++ "getrandom",
++]
++
++[[package]]
++name = "rand_hc"
++version = "0.2.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
++dependencies = [
++ "rand_core",
++]
++
++[[package]]
++name = "redox_syscall"
++version = "0.1.57"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
++
++[[package]]
++name = "regex"
++version = "1.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
++dependencies = [
++ "aho-corasick",
++ "memchr",
++ "regex-syntax",
++ "thread_local",
++]
++
++[[package]]
++name = "regex-syntax"
++version = "0.6.18"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
++
++[[package]]
++name = "remove_dir_all"
++version = "0.5.3"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
++dependencies = [
++ "winapi",
++]
++
++[[package]]
++name = "rustc-demangle"
++version = "0.1.16"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
++
++[[package]]
++name = "ryu"
++version = "1.0.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
++
++[[package]]
++name = "sandboxfs"
++version = "0.2.0"
++dependencies = [
++ "cpuprofiler",
++ "env_logger",
++ "failure",
++ "fuse",
++ "getopts",
++ "log 0.4.11",
++ "nix",
++ "num_cpus",
++ "pkg-config",
++ "serde",
++ "serde_derive",
++ "serde_json",
++ "signal-hook",
++ "tempfile",
++ "threadpool",
++ "time",
++ "users",
++ "xattr",
++]
++
++[[package]]
++name = "serde"
++version = "1.0.116"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
++
++[[package]]
++name = "serde_derive"
++version = "1.0.116"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++]
++
++[[package]]
++name = "serde_json"
++version = "1.0.58"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4"
++dependencies = [
++ "itoa",
++ "ryu",
++ "serde",
++]
++
++[[package]]
++name = "signal-hook"
++version = "0.1.16"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed"
++dependencies = [
++ "libc",
++ "signal-hook-registry",
++]
++
++[[package]]
++name = "signal-hook-registry"
++version = "1.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
++dependencies = [
++ "arc-swap",
++ "libc",
++]
++
++[[package]]
++name = "syn"
++version = "1.0.42"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "unicode-xid",
++]
++
++[[package]]
++name = "synstructure"
++version = "0.12.4"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
++dependencies = [
++ "proc-macro2",
++ "quote",
++ "syn",
++ "unicode-xid",
++]
++
++[[package]]
++name = "tempfile"
++version = "3.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
++dependencies = [
++ "cfg-if",
++ "libc",
++ "rand",
++ "redox_syscall",
++ "remove_dir_all",
++ "winapi",
++]
++
++[[package]]
++name = "termcolor"
++version = "1.1.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
++dependencies = [
++ "winapi-util",
++]
++
++[[package]]
++name = "thread-scoped"
++version = "1.0.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "bcbb6aa301e5d3b0b5ef639c9a9c7e2f1c944f177b460c04dc24c69b1fa2bd99"
++
++[[package]]
++name = "thread_local"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
++dependencies = [
++ "lazy_static",
++]
++
++[[package]]
++name = "threadpool"
++version = "1.8.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
++dependencies = [
++ "num_cpus",
++]
++
++[[package]]
++name = "time"
++version = "0.1.44"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
++dependencies = [
++ "libc",
++ "wasi 0.10.0+wasi-snapshot-preview1",
++ "winapi",
++]
++
++[[package]]
++name = "unicode-width"
++version = "0.1.8"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
++
++[[package]]
++name = "unicode-xid"
++version = "0.2.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
++
++[[package]]
++name = "users"
++version = "0.9.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "c72f4267aea0c3ec6d07eaabea6ead7c5ddacfafc5e22bcf8d186706851fb4cf"
++dependencies = [
++ "libc",
++]
++
++[[package]]
++name = "version_check"
++version = "0.9.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
++
++[[package]]
++name = "void"
++version = "1.0.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
++
++[[package]]
++name = "wasi"
++version = "0.9.0+wasi-snapshot-preview1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
++
++[[package]]
++name = "wasi"
++version = "0.10.0+wasi-snapshot-preview1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
++
++[[package]]
++name = "winapi"
++version = "0.3.9"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
++dependencies = [
++ "winapi-i686-pc-windows-gnu",
++ "winapi-x86_64-pc-windows-gnu",
++]
++
++[[package]]
++name = "winapi-i686-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
++
++[[package]]
++name = "winapi-util"
++version = "0.1.5"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
++dependencies = [
++ "winapi",
++]
++
++[[package]]
++name = "winapi-x86_64-pc-windows-gnu"
++version = "0.4.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
++
++[[package]]
++name = "xattr"
++version = "0.2.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c"
++dependencies = [
++ "libc",
++]
diff --git a/nixpkgs/pkgs/tools/filesystems/sandboxfs/default.nix b/nixpkgs/pkgs/tools/filesystems/sandboxfs/default.nix
new file mode 100644
index 000000000000..7d6d61198786
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sandboxfs/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, fetchFromGitHub
+, rustPlatform
+, fuse
+, pkg-config
+, installShellFiles
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "sandboxfs";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "bazelbuild";
+    repo = pname;
+    rev = "sandboxfs-${version}";
+    sha256 = "Ia6rq6FN4abnvLXjlQh4Q+8ra5JThKnC86UXC7s9//U=";
+  };
+
+  cargoSha256 = "sha256-fAPMAVvcI3pm3zTLATO7SUdZpG469fjlBZshFhgv6gY=";
+
+  # Issue to add Cargo.lock upstream: https://github.com/bazelbuild/sandboxfs/pull/115
+  cargoPatches = [ ./Cargo.lock.patch ];
+
+  nativeBuildInputs = [ pkg-config installShellFiles ];
+
+  buildInputs = [ fuse ];
+
+  postInstall = "installManPage man/sandboxfs.1";
+
+  meta = with lib; {
+    description = "A virtual file system for sandboxing";
+    homepage = "https://github.com/bazelbuild/sandboxfs";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ jeremyschlatter ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix b/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix
new file mode 100644
index 000000000000..b14dc620e421
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchurl
+, xz
+, lzo
+, zlib
+, zstd
+, lz4
+, lz4Support ? false
+}:
+
+let
+  patch = fetchFromGitHub
+    {
+      # NOTE: This uses my personal fork for now, until
+      # https://github.com/devttys0/sasquatch/pull/40 is merged.
+      # I, cole-h, will keep this fork available until that happens.
+      owner = "cole-h";
+      repo = "sasquatch";
+      rev = "6edc54705454c6410469a9cb5bc58e412779731a";
+      sha256 = "x+PuPYGD4Pd0fcJtlLWByGy/nggsmZkxwSXxJfPvUgo=";
+    } + "/patches/patch0.txt";
+in
+stdenv.mkDerivation rec {
+  pname = "sasquatch";
+  version = "4.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/squashfs/squashfs${version}.tar.gz";
+    sha256 = "qYGz8/IFS1ouZYhRo8BqJGCtBKmopkXgr+Bjpj/bsH4=";
+  };
+
+  buildInputs = [
+    xz
+    lzo
+    zlib
+    zstd
+  ]
+  ++ lib.optionals lz4Support [ lz4 ];
+
+  patches = [ patch ];
+  patchFlags = [ "-p0" ];
+
+  postPatch = ''
+    cd squashfs-tools
+  '';
+
+  installFlags = [ "INSTALL_DIR=\${out}/bin" ];
+
+  makeFlags = [ "XZ_SUPPORT=1" ]
+    ++ lib.optional lz4Support "LZ4_SUPPORT=1";
+
+  meta = with lib; {
+    homepage = "https://github.com/devttys0/sasquatch";
+    description = "Set of patches to the standard unsquashfs utility (part of squashfs-tools) that attempts to add support for as many hacked-up vendor-specific SquashFS implementations as possible";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.pamplemousse ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/securefs/add-macfuse-support.patch b/nixpkgs/pkgs/tools/filesystems/securefs/add-macfuse-support.patch
new file mode 100644
index 000000000000..217f637ff9db
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/securefs/add-macfuse-support.patch
@@ -0,0 +1,188 @@
+From 8c65c2219976c02a68e27c28156ec0c4c02857e0 Mon Sep 17 00:00:00 2001
+From: midchildan <git@midchildan.org>
+Date: Sun, 28 Mar 2021 23:39:59 +0900
+Subject: [PATCH] Support the latest FUSE on macOS
+
+This drops osxfuse support in favor of macFUSE. macFUSE is a newer
+version of osxfuse that supports the latest release of macOS, and is a
+rebranded version of the same project.
+---
+ CMakeLists.txt             |  8 ++----
+ LICENSE.md                 | 58 ++++++++++++++++++++------------------
+ README.md                  |  2 +-
+ sources/commands.cpp       |  6 ----
+ 4 files changed, 33 insertions(+), 41 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7b5e57d..c176554 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,12 +18,8 @@ git_describe(GIT_VERSION --tags)
+ configure_file(${CMAKE_SOURCE_DIR}/sources/git-version.cpp.in ${CMAKE_BINARY_DIR}/git-version.cpp)
+ 
+ if (UNIX)
+-    find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include PATH_SUFFIXES osxfuse)
+-    if (APPLE)
+-        find_library(FUSE_LIBRARIES osxfuse PATHS /usr/local/lib)
+-    else()
+-        find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
+-    endif()
++    find_path(FUSE_INCLUDE_DIR fuse.h PATHS /usr/local/include)
++    find_library(FUSE_LIBRARIES fuse PATHS /usr/local/lib)
+     include_directories(${FUSE_INCLUDE_DIR})
+     link_libraries(${FUSE_LIBRARIES})
+     add_compile_options(-Wall -Wextra -Wno-unknown-pragmas)
+diff --git a/LICENSE.md b/LICENSE.md
+index a8f920c..b134532 100644
+--- a/LICENSE.md
++++ b/LICENSE.md
+@@ -758,13 +758,11 @@ Public License instead of this License.
+ 
+ ------------------------------------------------------------------------------
+ 
+-# [osxfuse] (https://github.com/osxfuse/osxfuse)
++# [macFUSE] (https://github.com/osxfuse/osxfuse)
+ 
+-FUSE for macOS is a software developed by the osxfuse project and is covered
+-under the following BSD-style license:
++macFUSE is covered under the following license:
+ 
+-  Copyright (c) 2011-2016 Benjamin Fleischer
+-  Copyright (c) 2011-2012 Erik Larsson
++  Copyright (c) 2011-2021 Benjamin Fleischer
+   All rights reserved.
+ 
+   Redistribution  and  use  in  source  and  binary  forms,  with   or   without
+@@ -775,9 +773,13 @@ under the following BSD-style license:
+   2. Redistributions in binary form must reproduce the above  copyright  notice,
+      this list of conditions and the following disclaimer in  the  documentation
+      and/or other materials provided with the distribution.
+-  3. Neither the name of osxfuse nor the names of its contributors may  be  used
+-     to endorse or promote products derived from this software without  specific
+-     prior written permission.
++  3. Neither the name of the copyright holder nor the names of its  contributors
++     may be used to endorse or  promote  products  derived  from  this  software 
++     without specific prior written permission.
++  4. Redistributions in binary form, bundled with commercial software,  are  not
++     allowed without  specific  prior  written  permission.  This  includes  the
++     automated download or installation or  both  of  the  binary  form  in  the
++     context of commercial software.
+ 
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND  CONTRIBUTORS  "AS  IS"
+   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT  NOT  LIMITED  TO,  THE
+@@ -791,9 +793,9 @@ under the following BSD-style license:
+   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  IF  ADVISED  OF  THE
+   POSSIBILITY OF SUCH DAMAGE.
+ 
+-FUSE for macOS is a fork of MacFUSE. MacFUSE has been developed by Google Inc..
+-Additional information and the original source of MacFUSE are available on
+-http://code.google.com/p/macfuse/. MacFUSE is covered under the following
++macFUSE is a fork of the legacy Google MacFUSE software. Additional information
++and the original source code of Google MacFUSE are available on
++http://code.google.com/p/macfuse/. Google MacFUSE is covered under the following
+ BSD-style license:
+ 
+   Copyright (c) 2007—2009 Google Inc.
+@@ -830,9 +832,9 @@ BSD-style license:
+ Portions of this package were derived from code developed by other authors.
+ Please read further for specific details.
+ 
+-* Unless otherwise noted, parts of the FUSE for macOS kernel extension contain
+-  code derived from the FreeBSD version of FUSE, which is covered under the
+-  following BSD-style license:
++* Unless otherwise noted, parts of the macFUSE kernel extension contain code
++  derived from the FreeBSD version of FUSE, which is covered under the following
++  BSD-style license:
+ 
+     Copyright (C) 2005 Csaba Henk. All rights reserved.
+ 
+@@ -856,12 +858,13 @@ Please read further for specific details.
+     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  OF  THE  USE  OF
+     THIS  SOFTWARE,  EVEN  IF  ADVISED  OF  THE  POSSIBILITY  OF  SUCH   DAMAGE.
+ 
+-* Parts of the FUSE for macOS kernel extension contain code derived from Tuxera
+-  Inc.'s "rebel" branch. The original source of the "rebel" branch is available
+-  on https://github.com/tuxera. These modifications are covered under the
+-  following BSD-style license:
++* Parts of the macFUSE kernel extension contain code derived from Tuxera's
++  "rebel" branch. The original source code of the "rebel" branch is available on
++  https://github.com/tuxera. These modifications are covered under the following
++  BSD-style license:
+ 
+     Copyright (c) 2010 Tuxera Inc.
++    Copyright (c) 2011-2012 Erik Larsson
+     All rights reserved.
+ 
+     Redistribution  and  use  in  source  and  binary  forms,  with  or  without
+@@ -888,9 +891,9 @@ Please read further for specific details.
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  OF  THE
+     POSSIBILITY OF SUCH DAMAGE.
+ 
+-* Parts of FUSE for macOS contain code derived from Fuse4X. The original source
+-  of Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under
+-  the following BSD-style license:
++* Parts of macFUSE contain code derived from Fuse4X. The original source code of
++  Fuse4X is available on https://github.com/fuse4x. Fuse4X is covered under the
++  following BSD-style license:
+ 
+     Copyright (c) 2011 Anatol Pomozov
+     All rights reserved.
+@@ -916,21 +919,20 @@ Please read further for specific details.
+     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  OF  THE
+     POSSIBILITY OF SUCH DAMAGE.
+ 
+-* Parts of the mount_osxfuse command-line program are covered under the Apple
++* Parts of the mount_macfuse command-line program are covered under the Apple
+   Public Source License (APSL). You can read the APSL at:
+ 
+     http://www.opensource.apple.com/license/apsl/
+ 
+-* fuse_kernel.h is an unmodified copy of the interface header from the Linux
++* fuse_kernel.h is a modified copy of the interface header from the Linux
+   FUSE distribution (https://github.com/libfuse/libfuse). fuse_kernel.h can be
+   redistributed either under the GPL or under the BSD license. It is being
+   redistributed here under the BSD license.
+ 
+-* fuse_nodehash.c is a slightly modified version of HashNode.c from an
+-  Apple Developer Technical Support (DTS) sample code example. The original
+-  source, which is available on
+-  http://developer.apple.com/library/mac/#samplecode/MFSLives/, has the
+-  following disclaimer:
++* fuse_nodehash.c is a modified version of HashNode.c from an Apple Developer
++  Technical Support (DTS) sample code example. The original source, which is
++  available on http://developer.apple.com/library/mac/#samplecode/MFSLives/,
++  has the following disclaimer:
+ 
+     Disclaimer: IMPORTANT: This Apple software  is  supplied  to  you  by  Apple
+     Computer, Inc.  Apple") in consideration of your agreement to the  following
+diff --git a/README.md b/README.md
+index 9085e96..6fe3592 100644
+--- a/README.md
++++ b/README.md
+@@ -28,7 +28,7 @@ There are already many encrypting filesystem in widespread use. Some notable one
+ 
+ ### macOS
+ 
+-Install with [Homebrew](https://brew.sh). [osxfuse](https://osxfuse.github.io) has to be installed beforehand.
++Install with [Homebrew](https://brew.sh). [macFUSE](https://osxfuse.github.io) has to be installed beforehand.
+ ```
+ brew install securefs
+ ```
+diff --git a/sources/commands.cpp b/sources/commands.cpp
+index a371212..862602b 100644
+--- a/sources/commands.cpp
++++ b/sources/commands.cpp
+@@ -1252,12 +1252,6 @@ class VersionCommand : public CommandBase
+                 printf("WinFsp %u.%u\n", vn >> 16, vn & 0xFFFFu);
+             }
+         }
+-#elif defined(__APPLE__)
+-        typedef const char* version_function(void);
+-        auto osx_version_func
+-            = reinterpret_cast<version_function*>(::dlsym(RTLD_DEFAULT, "osxfuse_version"));
+-        if (osx_version_func)
+-            printf("osxfuse %s\n", osx_version_func());
+ #else
+         typedef int version_function(void);
+         auto fuse_version_func
+
diff --git a/nixpkgs/pkgs/tools/filesystems/securefs/default.nix b/nixpkgs/pkgs/tools/filesystems/securefs/default.nix
new file mode 100644
index 000000000000..44e547b01c24
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/securefs/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake
+, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "securefs";
+  version = "0.11.1";
+
+  src = fetchFromGitHub {
+    sha256 = "1sxfgqgy63ml7vg7zj3glvra4wj2qmfv9jzmpm1jqy8hq7qlqlsx";
+    rev = version;
+    repo = "securefs";
+    owner = "netheril96";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # Make it build with macFUSE
+    # Backported from https://github.com/netheril96/securefs/pull/114
+    ./add-macfuse-support.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fuse ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Transparent encryption filesystem";
+    longDescription = ''
+      Securefs is a filesystem in userspace (FUSE) that transparently encrypts
+      and authenticates data stored. It is particularly designed to secure
+      data stored in the cloud.
+      Securefs mounts a regular directory onto a mount point. The mount point
+      appears as a regular filesystem, where one can read/write/create files,
+      directories and symbolic links. The underlying directory will be
+      automatically updated to contain the encrypted and authenticated
+      contents.
+    '';
+    license = with licenses; [ bsd2 mit ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/sftpman/default.nix b/nixpkgs/pkgs/tools/filesystems/sftpman/default.nix
new file mode 100644
index 000000000000..e89012b76f63
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sftpman/default.nix
@@ -0,0 +1,25 @@
+{ lib, python3Packages, fetchFromGitHub }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "sftpman";
+  version = "1.1.3";
+
+  src = fetchFromGitHub {
+    owner = "spantaleev";
+    repo = pname;
+    rev = version;
+    sha256 = "04awwwfw51fi1q18xdysp54jyhr0rhb4kfyrgv0vhhrlpwwyhnqy";
+  };
+
+  checkPhase = ''
+    $out/bin/sftpman help
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/spantaleev/sftpman";
+    description = "Application that handles sshfs/sftp file systems mounting";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ contrun ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix b/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix
new file mode 100644
index 000000000000..d0d7304c9d20
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "simg2img";
+  version = "1.1.4";
+
+  src = fetchFromGitHub {
+    owner = "anestisb";
+    repo = "android-simg2img";
+    rev = version;
+    sha256 = "1xm9kaqs2w8c7a4psv78gv66gild88mpgjn5lj087d7jh1jxy7bf";
+  };
+
+  buildInputs = [ zlib ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Tool to convert Android sparse images to raw images";
+    homepage = "https://github.com/anestisb/android-simg2img";
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.dezgeg ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix
new file mode 100644
index 000000000000..3bbff2903bc7
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, fuse, samba, pkg-config, glib, autoconf, attr, libsecret }:
+
+stdenv.mkDerivation rec {
+  pname = "smbnetfs";
+  version = "0.6.3";
+  src = fetchurl {
+    url = "mirror://sourceforge/project/smbnetfs/smbnetfs/SMBNetFS-${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-6sN7l2n76cP0uvPrZMYaa1mtTyqgXf3culoaxK301WA=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoconf ];
+  buildInputs = [ fuse samba glib attr libsecret ];
+
+  meta = with lib; {
+    description = "A FUSE FS for mounting Samba shares";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    downloadPage = "https://sourceforge.net/projects/smbnetfs/files/smbnetfs";
+    updateWalker = true;
+    inherit version;
+    homepage = "https://sourceforge.net/projects/smbnetfs/";
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream
new file mode 100644
index 000000000000..d56fa42f1d1b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream
@@ -0,0 +1,6 @@
+url https://sourceforge.net/projects/smbnetfs/files/smbnetfs/
+version_link '[-][0-9.]+[a-z]*/$'
+version_link '[.]tar[.][a-z0-9]+/download$'
+SF_redirect
+version '.*[-]([0-9.]+[a-z]*)[.]tar[.].*' '\1'
+do_overwrite () { do_overwrite_just_version; }
diff --git a/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix b/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix
new file mode 100644
index 000000000000..d854558b7920
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "snapraid";
+  version = "11.5";
+
+  src = fetchFromGitHub {
+    owner = "amadvance";
+    repo = "snapraid";
+    rev = "v${version}";
+    sha256 = "0dlhdsmq5l208zldfr9z9g0p67wry81dr0r23lpybb5c9fm2f2rm";
+  };
+
+  VERSION = version;
+
+  doCheck = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ];
+
+  meta = {
+    homepage = "http://www.snapraid.it/";
+    description = "A backup program for disk arrays";
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.makefu ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix
new file mode 100644
index 000000000000..8661740d8074
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, doxygen, graphviz, perl, pkg-config
+, bzip2, lz4, lzo, xz, zlib, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "squashfs-tools-ng";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "https://infraroot.at/pub/squashfs/squashfs-tools-ng-${version}.tar.xz";
+    sha256 = "07c8vpzgwvqr9ycww1769ya40cf077c6igdg1b4akwszz2nw0bxq";
+  };
+
+  nativeBuildInputs = [ doxygen graphviz pkg-config perl ];
+  buildInputs = [ bzip2 zlib xz lz4 lzo zstd ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/AgentD/squashfs-tools-ng";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ qyliss ];
+    platforms = platforms.unix;
+
+    # TODO: Remove once nixpkgs uses newer SDKs that supports '*at' functions.
+    # Probably macOS SDK 10.13 or later. Check the current version in
+    # ../../../../os-specific/darwin/apple-sdk/default.nix
+    #
+    # From the build logs:
+    #
+    # > Undefined symbols for architecture x86_64:
+    # >   "_utimensat", referenced from:
+    # >       _set_attribs in rdsquashfs-restore_fstree.o
+    # > ld: symbol(s) not found for architecture x86_64
+    broken = stdenv.isDarwin && stdenv.isx86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/0001-Mksquashfs-add-no-hardlinks-option.patch b/nixpkgs/pkgs/tools/filesystems/squashfs/0001-Mksquashfs-add-no-hardlinks-option.patch
new file mode 100644
index 000000000000..0d6804a647b2
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfs/0001-Mksquashfs-add-no-hardlinks-option.patch
@@ -0,0 +1,76 @@
+From d925c9a11ee2e88ac8aac03f51892746f2bcf8cd Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip@squashfs.org.uk>
+Date: Thu, 25 Feb 2021 23:12:10 +0000
+Subject: [PATCH] Mksquashfs: add -no-hardlinks option
+
+Normally Mksquashfs will detect hardlinks (multiple files with the
+same inode) and hardlink them in the Squashfs image.
+
+But often hardlinks are used in the original filesystem
+to save space, when files are discovered to be duplicate.
+In this special case the only reason the files are
+hardlinked is to save space, and where the filesystem
+doesn't handle duplicate files (different inode, same
+data).
+
+Squashfs does handle duplicate files, and so add
+an option to ignore hardlinks and instead
+store them as duplicates.
+
+Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index a45b77f..d4dc359 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -312,6 +312,9 @@ struct dir_info *root_dir;
+ FILE *log_fd;
+ int logging=FALSE;
+ 
++/* Should Mksquashfs detect hardlinked files? */
++int no_hardlinks = FALSE;
++
+ static char *read_from_disk(long long start, unsigned int avail_bytes);
+ void add_old_root_entry(char *name, squashfs_inode inode, int inode_number,
+ 	int type);
+@@ -3093,11 +3096,11 @@ struct inode_info *lookup_inode3(struct stat *buf, int pseudo, int id,
+ 
+ 	/*
+ 	 * Look-up inode in hash table, if it already exists we have a
+-	 * hard-link, so increment the nlink count and return it.
+-	 * Don't do the look-up for directories because we don't hard-link
+-	 * directories.
++	 * hardlink, so increment the nlink count and return it.
++	 * Don't do the look-up for directories because Unix/Linux doesn't
++	 * allow hard-links to directories.
+ 	 */
+-	if ((buf->st_mode & S_IFMT) != S_IFDIR) {
++	if ((buf->st_mode & S_IFMT) != S_IFDIR && !no_hardlinks) {
+ 		for(inode = inode_info[ino_hash]; inode; inode = inode->next) {
+ 			if(memcmp(buf, &inode->buf, sizeof(struct stat)) == 0) {
+ 				inode->nlink ++;
+@@ -5447,7 +5450,9 @@ int main(int argc, char *argv[])
+ 		comp = lookup_compressor(COMP_DEFAULT);
+ 
+ 	for(i = source + 2; i < argc; i++) {
+-		if(strcmp(argv[i], "-mkfs-time") == 0 ||
++		if(strcmp(argv[i], "-no-hardlinks") == 0)
++			no_hardlinks = TRUE;
++		else if(strcmp(argv[i], "-mkfs-time") == 0 ||
+ 				strcmp(argv[i], "-fstime") == 0) {
+ 			if((++i == argc) || !parse_num_unsigned(argv[i], &mkfs_time)) {
+ 				ERROR("%s: %s missing or invalid time value\n", argv[0], argv[i - 1]);
+@@ -5893,6 +5898,7 @@ printOptions:
+ 				"files larger than block size\n");
+ 			ERROR("-no-duplicates\t\tdo not perform duplicate "
+ 				"checking\n");
++			ERROR("-no-hardlinks\t\tdo not hardlink files, instead store duplicates\n");
+ 			ERROR("-all-root\t\tmake all files owned by root\n");
+ 			ERROR("-root-mode <mode>\tset root directory permissions to octal <mode>\n");
+ 			ERROR("-force-uid <uid>\tset all file uids to <uid>\n");
+-- 
+2.30.0
+
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch b/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch
new file mode 100644
index 000000000000..e73c06788756
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch
@@ -0,0 +1,98 @@
+This patch has been edited to apply to squashfs 4.4, commit
+52eb4c279cd283ed9802dd1ceb686560b22ffb67. Below is the original
+message body of the patch.
+
+From 7bda7c75748f36b0a50f93e46144d5a4de4974ad Mon Sep 17 00:00:00 2001
+From: Amin Hassani <ahassani@google.com>
+Date: Thu, 15 Dec 2016 10:43:15 -0800
+Subject: [PATCH] mksquashfs 4K aligns the files inside the squashfs image
+
+Files inside a squashfs image are not necessarily 4k (4096)
+aligned. This patch starts each file in a 4k aligned address and pads
+zero to the end of the file until it reaches the next 4k aligned
+address. This will not change the size of the compressed
+blocks (especially the last one) and hence it will not change how the
+files are being loaded in kernel or unsquashfs. However on average this
+increases the size of the squashfs image which can be calculated by the
+following formula:
+
+increased_size = (number_of_unfragmented_files_in_image + number of fragments) * 2048
+
+The 4k alignment can be enabled by flag '-4k-align'
+---
+ squashfs-tools/mksquashfs.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index a45b77f..07b1c06 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -102,7 +102,9 @@ int old_exclude = TRUE;
+ int use_regex = FALSE;
+ int nopad = FALSE;
+ int exit_on_error = FALSE;
++int do_4k_align = FALSE;
+ long long start_offset = 0;
++#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1))
+ 
+ long long global_uid = -1, global_gid = -1;
+ 
+@@ -1546,6 +1548,9 @@ void unlock_fragments()
+ 	 * queue at this time.
+ 	 */
+ 	while(!queue_empty(locked_fragment)) {
++		// 4k align the start of remaining queued fragments.
++		if(do_4k_align)
++			ALIGN_UP(bytes, 4096);
+ 		write_buffer = queue_get(locked_fragment);
+ 		frg = write_buffer->block;	
+ 		size = SQUASHFS_COMPRESSED_SIZE_BLOCK(fragment_table[frg].size);
+@@ -2478,6 +2483,9 @@ void *frag_deflator(void *arg)
+ 		write_buffer->size = compressed_size;
+ 		pthread_mutex_lock(&fragment_mutex);
+ 		if(fragments_locked == FALSE) {
++			// 4k align the start of each fragment.
++			if(do_4k_align)
++				ALIGN_UP(bytes, 4096);
+ 			fragment_table[file_buffer->block].size = c_byte;
+ 			fragment_table[file_buffer->block].start_block = bytes;
+ 			write_buffer->block = bytes;
+@@ -2877,6 +2885,10 @@ int write_file_blocks(squashfs_inode *inode, struct dir_ent *dir_ent,
+ 	long long sparse = 0;
+ 	struct file_buffer *fragment_buffer = NULL;
+ 
++	// 4k align the start of each file.
++	if(do_4k_align)
++		ALIGN_UP(bytes, 4096);
++
+ 	if(pre_duplicate(read_size))
+ 		return write_file_blocks_dup(inode, dir_ent, read_buffer, dup);
+ 
+@@ -4972,6 +4984,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad)
+ 		"compressed", no_fragments ? "no" : noF ? "uncompressed" :
+ 		"compressed", no_xattrs ? "no" : noX ? "uncompressed" :
+ 		"compressed", noI || noId ? "uncompressed" : "compressed");
++	printf("\t4k %saligned\n", do_4k_align ? "" : "un");
+ 	printf("\tduplicates are %sremoved\n", duplicate_checking ? "" :
+ 		"not ");
+ 	printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0,
+@@ -5853,6 +5866,8 @@ print_compressor_options:
+ 			root_name = argv[i];
+ 		} else if(strcmp(argv[i], "-version") == 0) {
+ 			VERSION();
++		} else if(strcmp(argv[i], "-4k-align") == 0) {
++			do_4k_align = TRUE;
+ 		} else {
+ 			ERROR("%s: invalid option\n\n", argv[0]);
+ printOptions:
+@@ -5904,6 +5919,7 @@ printOptions:
+ 			ERROR("\t\t\tdirectory containing that directory, "
+ 				"rather than the\n");
+ 			ERROR("\t\t\tcontents of the directory\n");
++			ERROR("-4k-align\t\tenables 4k alignment of all files\n");
+ 			ERROR("\nFilesystem filter options:\n");
+ 			ERROR("-p <pseudo-definition>\tAdd pseudo file "
+ 				"definition\n");
+-- 
+2.23.0
+
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch b/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch
new file mode 100644
index 000000000000..eb2dc24ec1a8
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch
@@ -0,0 +1,357 @@
+Patch based on commits by Dave Vasilevsky <dave@vasilevsky.ca> and
+Blake Riley <blake.riley@gmail.com>, squashed into a single patch,
+with BSD-specific changes omitted.
+
+See also https://github.com/plougher/squashfs-tools/pull/69.
+
+diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c
+index 4b06ccb..3cad2ab 100644
+--- a/squashfs-tools/action.c
++++ b/squashfs-tools/action.c
+@@ -38,6 +38,10 @@
+ #include <limits.h>
+ #include <errno.h>
+ 
++#ifndef FNM_EXTMATCH /* glibc extension */
++	#define FNM_EXTMATCH 0
++#endif
++
+ #include "squashfs_fs.h"
+ #include "mksquashfs.h"
+ #include "action.h"
+@@ -2284,9 +2288,12 @@ static char *get_start(char *s, int n)
+ 
+ static int subpathname_fn(struct atom *atom, struct action_data *action_data)
+ {
+-	return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath),
++	char *path = strdup(action_data->subpath);
++	int is_match = fnmatch(atom->argv[0], get_start(path,
+ 		count_components(atom->argv[0])),
+ 		FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0;
++	free(path);
++	return is_match;
+ }
+ 
+ /*
+diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c
+index fe23d78..5c2f835 100644
+--- a/squashfs-tools/info.c
++++ b/squashfs-tools/info.c
+@@ -144,31 +144,22 @@ void dump_state()
+ void *info_thrd(void *arg)
+ {
+ 	sigset_t sigmask;
+-	struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
+-	int sig, waiting = 0;
++	int sig, err, waiting = 0;
+ 
+ 	sigemptyset(&sigmask);
+ 	sigaddset(&sigmask, SIGQUIT);
+ 	sigaddset(&sigmask, SIGHUP);
++	sigaddset(&sigmask, SIGALRM);
+ 
+ 	while(1) {
+-		if(waiting)
+-			sig = sigtimedwait(&sigmask, NULL, &timespec);
+-		else
+-			sig = sigwaitinfo(&sigmask, NULL);
++		err = sigwait(&sigmask, &sig);
+ 
+-		if(sig == -1) {
++		if(err == -1) {
+ 			switch(errno) {
+-			case EAGAIN:
+-				/* interval timed out */
+-				waiting = 0;
+-				/* FALLTHROUGH */
+ 			case EINTR:
+-				/* if waiting, the wait will be longer, but
+-				   that's OK */
+ 				continue;
+ 			default:
+-				BAD_ERROR("sigtimedwait/sigwaitinfo failed "
++				BAD_ERROR("sigwait failed "
+ 					"because %s\n", strerror(errno));
+ 			}
+ 		}
+@@ -179,8 +170,12 @@ void *info_thrd(void *arg)
+ 			/* set one second interval period, if ^\ received
+ 			   within then, dump queue and cache status */
+ 			waiting = 1;
+-		} else
++			alarm(1);
++		} else if (sig == SIGQUIT) {
+ 			dump_state();
++		} else if (sig == SIGALRM) {
++			waiting = 0;
++		}
+ 	}
+ }
+ 
+diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
+index a45b77f..3607448 100644
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -35,7 +35,12 @@
+ #include <stddef.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifndef linux
++#include <sys/sysctl.h>
++#else
++#include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
++#endif
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <dirent.h>
+@@ -50,7 +55,10 @@
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <ctype.h>
+-#include <sys/sysinfo.h>
++
++#ifndef FNM_EXTMATCH /* glibc extension */
++	#define FNM_EXTMATCH 0
++#endif
+ 
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+@@ -4348,6 +4356,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq,
+ 	sigemptyset(&sigmask);
+ 	sigaddset(&sigmask, SIGQUIT);
+ 	sigaddset(&sigmask, SIGHUP);
++	sigaddset(&sigmask, SIGALRM);
+ 	if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0)
+ 		BAD_ERROR("Failed to set signal mask in intialise_threads\n");
+ 
+@@ -5195,6 +5204,35 @@ int get_physical_memory()
+ 	long long page_size = sysconf(_SC_PAGESIZE);
+ 	int phys_mem;
+ 
++#ifndef linux
++	#ifdef HW_MEMSIZE
++		#define SYSCTL_PHYSMEM HW_MEMSIZE
++	#elif defined(HW_PHYSMEM64)
++		#define SYSCTL_PHYSMEM HW_PHYSMEM64
++	#else
++		#define SYSCTL_PHYSMEM HW_PHYSMEM
++	#endif
++
++	int mib[2];
++	uint64_t sysctl_physmem = 0;
++	size_t sysctl_len = sizeof(sysctl_physmem);
++
++	mib[0] = CTL_HW;
++	mib[1] = SYSCTL_PHYSMEM;
++
++	if(sysctl(mib, 2, &sysctl_physmem, &sysctl_len, NULL, 0) == 0) {
++		/* some systems use 32-bit values, work with what we're given */
++		if (sysctl_len == 4)
++			sysctl_physmem = *(uint32_t*)&sysctl_physmem;
++		phys_mem = sysctl_physmem >> 20;
++	} else {
++		ERROR_START("Failed to get amount of available "
++			"memory.");
++		ERROR_EXIT("  Defaulting to least viable amount\n");
++		phys_mem = SQUASHFS_LOWMEM;
++	}
++  #undef SYSCTL_PHYSMEM
++#else
+ 	if(num_pages == -1 || page_size == -1) {
+ 		struct sysinfo sys;
+ 		int res = sysinfo(&sys);
+@@ -5207,6 +5245,7 @@ int get_physical_memory()
+ 	}
+ 
+ 	phys_mem = num_pages * page_size >> 20;
++#endif
+ 
+ 	if(phys_mem < SQUASHFS_LOWMEM)
+ 		BAD_ERROR("Mksquashfs requires more physical memory than is "
+diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c
+index 4debedf..3257c30 100644
+--- a/squashfs-tools/read_xattrs.c
++++ b/squashfs-tools/read_xattrs.c
+@@ -39,13 +39,13 @@
+ #include <endian.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ #include "squashfs_fs.h"
+ #include "squashfs_swap.h"
+ #include "xattr.h"
+ #include "error.h"
+ 
+-#include <stdlib.h>
+-
+ extern int read_fs_bytes(int, long long, int, void *);
+ extern int read_block(int, long long, long long *, int, void *);
+ 
+diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c
+index 727f1d5..c1a6183 100644
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -32,8 +32,12 @@
+ #include "stdarg.h"
+ #include "fnmatch_compat.h"
+ 
++#ifndef linux
++#include <sys/sysctl.h>
++#else
+ #include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
+@@ -1080,7 +1084,7 @@ int create_inode(char *pathname, struct inode *i)
+ 			break;
+ 		case SQUASHFS_SYMLINK_TYPE:
+ 		case SQUASHFS_LSYMLINK_TYPE: {
+-			struct timespec times[2] = {
++			struct timeval times[2] = {
+ 				{ i->time, 0 },
+ 				{ i->time, 0 }
+ 			};
+@@ -1099,8 +1103,7 @@ int create_inode(char *pathname, struct inode *i)
+ 				goto failed;
+ 			}
+ 
+-			res = utimensat(AT_FDCWD, pathname, times,
+-					AT_SYMLINK_NOFOLLOW);
++			res = lutimes(pathname, times);
+ 			if(res == -1) {
+ 				EXIT_UNSQUASH_STRICT("create_inode: failed to set time on "
+ 					"%s, because %s\n", pathname,
+@@ -2235,6 +2238,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size)
+ 	sigemptyset(&sigmask);
+ 	sigaddset(&sigmask, SIGQUIT);
+ 	sigaddset(&sigmask, SIGHUP);
++	sigaddset(&sigmask, SIGALRM);
+ 	if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0)
+ 		EXIT_UNSQUASH("Failed to set signal mask in initialise_threads"
+ 			"\n");
+diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h
+index 934618b..0e680ab 100644
+--- a/squashfs-tools/unsquashfs.h
++++ b/squashfs-tools/unsquashfs.h
+@@ -46,6 +46,10 @@
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+ 
++#ifndef FNM_EXTMATCH /* glibc extension */
++	#define FNM_EXTMATCH 0
++#endif
++
+ #ifndef linux
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __BIG_ENDIAN BIG_ENDIAN
+diff --git a/squashfs-tools/unsquashfs_info.c b/squashfs-tools/unsquashfs_info.c
+index c8e2b9b..7d4f7af 100644
+--- a/squashfs-tools/unsquashfs_info.c
++++ b/squashfs-tools/unsquashfs_info.c
+@@ -97,31 +97,22 @@ void dump_state()
+ void *info_thrd(void *arg)
+ {
+ 	sigset_t sigmask;
+-	struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
+-	int sig, waiting = 0;
++	int sig, err, waiting = 0;
+ 
+ 	sigemptyset(&sigmask);
+ 	sigaddset(&sigmask, SIGQUIT);
+ 	sigaddset(&sigmask, SIGHUP);
++	sigaddset(&sigmask, SIGALRM);
+ 
+ 	while(1) {
+-		if(waiting)
+-			sig = sigtimedwait(&sigmask, NULL, &timespec);
+-		else
+-			sig = sigwaitinfo(&sigmask, NULL);
++		err = sigwait(&sigmask, &sig);
+ 
+-		if(sig == -1) {
++		if(err == -1) {
+ 			switch(errno) {
+-			case EAGAIN:
+-				/* interval timed out */
+-				waiting = 0;
+-				/* FALLTHROUGH */
+ 			case EINTR:
+-				/* if waiting, the wait will be longer, but
+-				   that's OK */
+ 				continue;
+ 			default:
+-				BAD_ERROR("sigtimedwait/sigwaitinfo failed "
++				BAD_ERROR("sigwait failed "
+ 					"because %s\n", strerror(errno));
+ 			}
+ 		}
+@@ -133,8 +124,12 @@ void *info_thrd(void *arg)
+ 			/* set one second interval period, if ^\ received
+ 			   within then, dump queue and cache status */
+ 			waiting = 1;
+-		} else
++			alarm(1);
++		} else if (sig == SIGQUIT) {
+ 			dump_state();
++		} else if (sig == SIGALRM) {
++			waiting = 0;
++		}
+ 	}
+ }
+ 
+diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c
+index 7742dfe..f8cd3b6 100644
+--- a/squashfs-tools/unsquashfs_xattr.c
++++ b/squashfs-tools/unsquashfs_xattr.c
+@@ -27,6 +27,11 @@
+ 
+ #include <sys/xattr.h>
+ 
++#ifdef XATTR_NOFOLLOW /* Apple's xattrs */
++	#define lsetxattr(path_, name_, val_, sz_, flags_) \
++		setxattr(path_, name_, val_, sz_, 0, flags_ | XATTR_NOFOLLOW)
++#endif
++
+ #define NOSPACE_MAX 10
+ 
+ extern int root_process;
+diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c
+index 64dfd82..d82d186 100644
+--- a/squashfs-tools/xattr.c
++++ b/squashfs-tools/xattr.c
+@@ -22,6 +22,14 @@
+  * xattr.c
+  */
+ 
++#ifndef linux
++#define __BYTE_ORDER BYTE_ORDER
++#define __BIG_ENDIAN BIG_ENDIAN
++#define __LITTLE_ENDIAN LITTLE_ENDIAN
++#else
++#include <endian.h>
++#endif
++
+ #define TRUE 1
+ #define FALSE 0
+ 
+@@ -36,6 +44,13 @@
+ #include <stdlib.h>
+ #include <sys/xattr.h>
+ 
++#ifdef XATTR_NOFOLLOW /* Apple's xattrs */
++	#define llistxattr(path_, buf_, sz_) \
++		listxattr(path_, buf_, sz_, XATTR_NOFOLLOW)
++	#define lgetxattr(path_, name_, val_, sz_) \
++		getxattr(path_, name_, val_, sz_, 0, XATTR_NOFOLLOW)
++#endif
++
+ #include "squashfs_fs.h"
+ #include "squashfs_swap.h"
+ #include "mksquashfs.h"
+-- 
+2.23.0
+
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix
new file mode 100644
index 000000000000..cddb1722584b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, xz
+, lz4
+, lzo
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "squashfs";
+  version = "4.4";
+
+  src = fetchFromGitHub {
+    owner = "plougher";
+    repo = "squashfs-tools";
+    rev = version;
+    sha256 = "0697fv8n6739mcyn57jclzwwbbqwpvjdfkv1qh9s56lvyqnplwaw";
+  };
+
+  patches = [
+    # This patch adds an option to pad filesystems (increasing size) in
+    # exchange for better chunking / binary diff calculation.
+    ./4k-align.patch
+    # Add -no-hardlinks option. This is a rebased version of
+    # c37bb4da4a5fa8c1cf114237ba364692dd522262, can be removed
+    # when upgrading to the next version after 4.4
+    ./0001-Mksquashfs-add-no-hardlinks-option.patch
+  ] ++ lib.optional stdenv.isDarwin ./darwin.patch;
+
+  buildInputs = [ zlib xz zstd lz4 lzo ];
+
+  preBuild = ''
+    cd squashfs-tools
+  '' ;
+
+  installFlags = [ "INSTALL_DIR=${placeholder "out"}/bin" ];
+
+  makeFlags = [
+    "XZ_SUPPORT=1"
+    "ZSTD_SUPPORT=1"
+    "LZ4_SUPPORT=1"
+    "LZO_SUPPORT=1"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/plougher/squashfs-tools";
+    description = "Tool for creating and unpacking squashfs filesystems";
+    platforms = platforms.unix;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ruuda ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix
new file mode 100644
index 000000000000..14a7f6024304
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool, fuse,
+  pkg-config, lz4, xz, zlib, lzo, zstd }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+
+  pname = "squashfuse";
+  version = "0.1.103";
+
+  src = fetchFromGitHub {
+    owner = "vasi";
+    repo  = pname;
+    rev = "540204955134eee44201d50132a5f66a246bcfaf";
+    sha256 = "062s77y32p80vc24a79z31g90b9wxzvws1xvicgx5fn1pd0xa0q6";
+  };
+
+  nativeBuildInputs = [ autoreconfHook libtool pkg-config ];
+  buildInputs = [ lz4 xz zlib lzo zstd fuse ];
+
+  meta = {
+    description = "FUSE filesystem to mount squashfs archives";
+    homepage = "https://github.com/vasi/squashfuse";
+    maintainers = [  ];
+    platforms = platforms.unix;
+    license = "BSD-2-Clause";
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/common.nix b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/common.nix
new file mode 100644
index 000000000000..f85faa712dd4
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/common.nix
@@ -0,0 +1,61 @@
+{ version, sha256, platforms, patches ? [ ] }:
+
+{ lib, stdenv, fetchFromGitHub
+, meson, pkg-config, ninja, docutils, makeWrapper
+, fuse3, macfuse-stubs, glib
+, which, python3Packages
+, openssh
+}:
+
+let
+  fuse = if stdenv.isDarwin then macfuse-stubs else fuse3;
+in stdenv.mkDerivation rec {
+  pname = "sshfs-fuse";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "libfuse";
+    repo = "sshfs";
+    rev = "sshfs-${version}";
+    inherit sha256;
+  };
+
+  inherit patches;
+
+  nativeBuildInputs = [ meson pkg-config ninja docutils makeWrapper ];
+  buildInputs = [ fuse glib ];
+  checkInputs = [ which python3Packages.pytest ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString
+    (stdenv.hostPlatform.system == "i686-linux")
+    "-D_FILE_OFFSET_BITS=64";
+
+  postInstall = ''
+    mkdir -p $out/sbin
+    ln -sf $out/bin/sshfs $out/sbin/mount.sshfs
+  '' + lib.optionalString (!stdenv.isDarwin) ''
+    wrapProgram $out/bin/sshfs --prefix PATH : "${openssh}/bin"
+  '';
+
+  # doCheck = true;
+  checkPhase = lib.optionalString (!stdenv.isDarwin) ''
+    # The tests need fusermount:
+    mkdir bin
+    cp ${fuse}/bin/fusermount3 bin/fusermount
+    export PATH=bin:$PATH
+    # Can't access /dev/fuse within the sandbox: "FUSE kernel module does not seem to be loaded"
+    substituteInPlace test/util.py --replace "/dev/fuse" "/dev/null"
+    # TODO: "fusermount executable not setuid, and we are not root"
+    # We should probably use a VM test instead
+    ${python3Packages.python.interpreter} -m pytest test/
+  '';
+
+  meta = with lib; {
+    inherit platforms;
+    description = "FUSE-based filesystem that allows remote filesystems to be mounted over SSH";
+    longDescription = macfuse-stubs.warning;
+    homepage = "https://github.com/libfuse/sshfs";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix
new file mode 100644
index 000000000000..879199347bd1
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, callPackage, fetchpatch }:
+
+let mkSSHFS = args: callPackage (import ./common.nix args) { };
+in if stdenv.isDarwin then
+  mkSSHFS {
+    version = "2.10"; # macFUSE isn't yet compatible with libfuse 3.x
+    sha256 = "1dmw4kx6vyawcywiv8drrajnam0m29mxfswcp4209qafzx3mjlp1";
+    patches = [
+      # remove reference to fuse_darwin.h which doens't exist on recent macFUSE
+      ./fix-fuse-darwin-h.patch
+
+      # From https://github.com/libfuse/sshfs/pull/185:
+      # > With this patch, setting I/O size to a reasonable large value, will
+      # > result in much improved performance, e.g.: -o iosize=1048576
+      (fetchpatch {
+        name = "fix-configurable-blksize.patch";
+        url = "https://github.com/libfuse/sshfs/commit/667cf34622e2e873db776791df275c7a582d6295.patch";
+        sha256 = "0d65lawd2g2aisk1rw2vl65dgxywf4vqgv765n9zj9zysyya8a54";
+      })
+    ];
+    platforms = lib.platforms.darwin;
+  }
+else
+  mkSSHFS {
+    version = "3.7.2";
+    sha256 = "0i0ycgwdxja8313hlkrlwrl85a4ykkyqddgg484jkr4rnr7ylk8w";
+    platforms = lib.platforms.linux;
+  }
diff --git a/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/fix-fuse-darwin-h.patch b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/fix-fuse-darwin-h.patch
new file mode 100644
index 000000000000..045cc0e61f33
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/fix-fuse-darwin-h.patch
@@ -0,0 +1,14 @@
+diff --git a/sshfs.c b/sshfs.c
+index 97eaf06..d442577 100644
+--- a/sshfs.c
++++ b/sshfs.c
+@@ -14,9 +14,6 @@
+ #if !defined(__CYGWIN__)
+ #include <fuse_lowlevel.h>
+ #endif
+-#ifdef __APPLE__
+-#  include <fuse_darwin.h>
+-#endif
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/nixpkgs/pkgs/tools/filesystems/supertag/default.nix b/nixpkgs/pkgs/tools/filesystems/supertag/default.nix
new file mode 100644
index 000000000000..a9a16582c115
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/supertag/default.nix
@@ -0,0 +1,41 @@
+{ lib, rustPlatform, fetchFromGitHub
+, clang, llvmPackages, pkg-config
+, dbus, fuse, sqlite
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "supertag";
+  version = "0.1.4";
+
+  src = fetchFromGitHub {
+    owner = "amoffat";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0jzm7pn38hlr96n0z8gqfsfdbw48y0nnbsgjdq7hpgwmcgvgqdam";
+  };
+
+  cargoSha256 = "093vrpp4in8854hb0h1lxrp8v6i9vfja0l69dnnp7z15qkpbir4f";
+
+  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+
+  nativeBuildInputs = [ clang pkg-config ];
+  buildInputs = [ dbus fuse sqlite ];
+
+  # The test are requiring extended permissions.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A tag-based filesystem";
+    longDescription = ''
+      Supertag is a tag-based filesystem, written in Rust, for Linux and MacOS.
+      It provides a tag-based view of your files by removing the hierarchy
+      constraints typically imposed on files and folders. In other words, it
+      allows you to think about your files not as objects stored in folders, but
+      as objects that can be filtered by folders.
+    '';
+    homepage = "https://github.com/amoffat/supertag";
+    license = licenses.agpl3Plus;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ oxzi ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix b/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix
new file mode 100644
index 000000000000..a192032aa938
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, autoreconfHook, subversion, fuse, apr, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "svnfs";
+  version = "0.4";
+
+  src = fetchurl {
+    url = "http://www.jmadden.eu/wp-content/uploads/svnfs/svnfs-${version}.tgz";
+    sha256 = "1lrzjr0812lrnkkwk60bws9k1hq2iibphm0nhqyv26axdsygkfky";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ subversion fuse apr perl ];
+
+  # autoconf's AC_CHECK_HEADERS and AC_CHECK_LIBS fail to detect libfuse on
+  # Darwin if FUSE_USE_VERSION isn't set at configure time.
+  #
+  # NOTE: Make sure the value of FUSE_USE_VERSION specified here matches the
+  # actual version used in the source code:
+  #
+  #     $ tar xf "$(nix-build -A svnfs.src)"
+  #     $ grep -R FUSE_USE_VERSION
+  configureFlags = lib.optionals stdenv.isDarwin [ "CFLAGS=-DFUSE_USE_VERSION=25" ];
+
+  # why is this required?
+  preConfigure=''
+    export LD_LIBRARY_PATH=${subversion.out}/lib
+  '';
+
+  NIX_CFLAGS_COMPILE="-I ${subversion.dev}/include/subversion-1";
+  NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1";
+
+  meta = {
+    description = "FUSE filesystem for accessing Subversion repositories";
+    homepage = "http://www.jmadden.eu/index.php/svnfs/";
+    license = lib.licenses.gpl2Only;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix b/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix
new file mode 100644
index 000000000000..aa3057202c74
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildGoPackage, fetchFromGitHub, installShellFiles }:
+
+buildGoPackage rec {
+  pname = "tmsu";
+  version = "0.7.5";
+  goPackagePath = "github.com/oniony/TMSU";
+
+  src = fetchFromGitHub {
+    owner = "oniony";
+    repo = "tmsu";
+    rev = "v${version}";
+    sha256 = "0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq";
+  };
+
+  goDeps = ./deps.nix;
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  preBuild = ''
+    mv go/src/${goPackagePath} src
+    mv src/src/${goPackagePath} go/src/${goPackagePath}
+    export GOPATH=$PWD:$GOPATH
+  '';
+
+  postInstall = ''
+    # can't do "mv TMSU tmsu" on case-insensitive filesystems
+    mv $out/bin/{TMSU,tmsu.tmp}
+    mv $out/bin/{tmsu.tmp,tmsu}
+
+    cp src/misc/bin/* $out/bin/
+    installManPage src/misc/man/tmsu.1
+    installShellCompletion --zsh src/misc/zsh/_tmsu
+  '';
+
+  meta = with lib; {
+    homepage    = "http://www.tmsu.org";
+    description = "A tool for tagging your files using a virtual filesystem";
+    maintainers = with maintainers; [ pSub ];
+    license     = licenses.gpl3Plus;
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/tmsu/deps.nix b/nixpkgs/pkgs/tools/filesystems/tmsu/deps.nix
new file mode 100644
index 000000000000..7dee6324b672
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/tmsu/deps.nix
@@ -0,0 +1,39 @@
+# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
+[
+  {
+    goPackagePath = "github.com/hanwen/go-fuse";
+    fetch = {
+      type = "git";
+      url = "https://github.com/hanwen/go-fuse";
+      rev = "0f728ba15b38579efefc3dc47821882ca18ffea7";
+      sha256 = "05ymw2pp58avf19wvi0cgdzqf3d88k1jdf6ldj4hmhbkm3waqf7l";
+    };
+  }
+  {
+    goPackagePath = "github.com/mattn/go-sqlite3";
+    fetch = {
+      type = "git";
+      url = "https://github.com/mattn/go-sqlite3";
+      rev = "98a44bcf5949f178c8116fa30e62c9ac2ef65927";
+      sha256 = "108rk74ringkkyx05zlq5khh32fsfi0przyzrpsr1r5j57xrhxj0";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/crypto";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/crypto";
+      rev = "3c4aac89819a5fdc28d906456729d3423fd46969";
+      sha256 = "16q9ay6bl28zrnb377p8lvrs2nd98h7i6y3yi8ccjwzg1czbfdsi";
+    };
+  }
+  {
+    goPackagePath = "golang.org/x/sys";
+    fetch = {
+      type = "git";
+      url = "https://go.googlesource.com/sys";
+      rev = "1957bb5e6d1f523308b49060df02171d06ddfc77";
+      sha256 = "0imqk4l9785rw7ddvywyf8zn7k3ga6f17ky8rmf8wrri7nknr03f";
+    };
+  }
+]
diff --git a/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix b/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix
new file mode 100644
index 000000000000..6abab83b0fd0
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "u3-tool";
+  version = "0.3";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1p9c9kibd1pdbdfa0nd0i3n7bvzi3xg0chm38jg3xfl8gsn0390f";
+  };
+
+  meta = with lib; {
+    description = "Tool for controlling the special features of a 'U3 smart drive' USB Flash disk";
+    homepage = "https://sourceforge.net/projects/u3-tool/";
+    license = licenses.gpl2;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ makefu ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/ubidump/default.nix b/nixpkgs/pkgs/tools/filesystems/ubidump/default.nix
new file mode 100644
index 000000000000..6a6409ad3251
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/ubidump/default.nix
@@ -0,0 +1,40 @@
+{ lib, fetchFromGitHub, python3, makeWrapper }:
+
+python3.pkgs.buildPythonApplication rec {
+
+  pname = "ubidump";
+  version = "unstable-2019-09-11";
+
+  src = fetchFromGitHub {
+    owner = "nlitsme";
+    repo = pname;
+    rev = "0691f1a9a38604c2baf8c9af6b826eb2632af74a";
+    sha256 = "1hiivlgni4r3nd5n2rzl5qzw6y2wpjpmyls5lybrc8imd6rmj3w2";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [ crcmod python-lzo ];
+
+  phases = [ "unpackPhase" "patchPhase" "installPhase" "installCheckPhase" ];
+
+  patchPhase = ''
+    sed -i '1s;^;#!${python3.interpreter}\n;' ubidump.py
+    patchShebangs ubidump.py
+  '';
+
+  installPhase = ''
+    install -D -m755 ubidump.py $out/bin/ubidump
+    wrapProgram $out/bin/ubidump --set PYTHONPATH $PYTHONPATH
+  '';
+
+  installCheckPhase = ''
+    $out/bin/ubidump -h  > /dev/null
+  '';
+
+  meta = with lib; {
+    description = "View or extract the contents of UBIFS images";
+    homepage = "https://github.com/nlitsme/ubidump";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sgo ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/tools/filesystems/udftools/default.nix b/nixpkgs/pkgs/tools/filesystems/udftools/default.nix
new file mode 100644
index 000000000000..ec3fd6efefae
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/udftools/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, ncurses, readline, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "udftools";
+  version = "2.0";
+  src = fetchFromGitHub {
+    owner = "pali";
+    repo = "udftools";
+    rev = version;
+    sha256 = "0mz04h3rki6ljwfs15z83gf4vv816w7xgz923waiqgmfj9xpvx87";
+  };
+
+  buildInputs = [ ncurses readline ];
+  nativeBuildInputs = [ autoreconfHook ];
+
+  hardeningDisable = [ "fortify" ];
+
+  NIX_CFLAGS_COMPILE = "-std=gnu90";
+
+  preConfigure = ''
+    sed -e '1i#include <limits.h>' -i cdrwtool/cdrwtool.c -i pktsetup/pktsetup.c
+    sed -e 's@[(]char[*][)]spm [+]=@spm = ((char*) spm) + @' -i wrudf/wrudf.c
+    sed -e '27i#include <string.h>' -i include/udf_endian.h
+    sed -e '38i#include <string.h>' -i wrudf/wrudf-cdrw.c
+    sed -e '12i#include <string.h>' -i wrudf/wrudf-cdr.c
+    sed -e '37i#include <stdlib.h>' -i wrudf/ide-pc.c
+    sed -e '46i#include <sys/sysmacros.h>' -i mkudffs/main.c
+
+    sed -e "s@\$(DESTDIR)/lib/udev/rules.d@$out/lib/udev/rules.d@" -i pktsetup/Makefile.am
+  '';
+
+  postFixup = ''
+    sed -i -e "s@/usr/sbin/pktsetup@$out/sbin/pktsetup@" $out/lib/udev/rules.d/80-pktsetup.rules
+  '';
+
+  meta = with lib; {
+    description = "UDF tools";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix
new file mode 100644
index 000000000000..6a34657d3d17
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fuse }:
+
+stdenv.mkDerivation rec {
+  pname = "unionfs-fuse";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "rpodgorny";
+    repo = "unionfs-fuse";
+    rev = "v${version}";
+    sha256 = "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm";
+  };
+
+  patches = [
+    # Prevent the unionfs daemon from being killed during
+    # shutdown. See
+    # http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/
+    # for details.
+    ./prevent-kill-on-shutdown.patch
+  ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace CMakeLists.txt \
+      --replace '/usr/local/include/osxfuse/fuse' '${fuse}/include/fuse'
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fuse ];
+
+  # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
+  # possible to do:
+  #   mount -t unionfs-fuse none /dest -o dirs=/source1=RW,/source2=RO
+  #
+  # This must be done in preConfigure because the build process removes
+  # helper from the source directory during the build.
+  preConfigure = lib.optionalString (!stdenv.isDarwin) ''
+    mkdir -p $out/sbin
+    cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
+    substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
+    substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs
+  '';
+
+  meta = with lib; {
+    description = "FUSE UnionFS implementation";
+    homepage = "https://github.com/rpodgorny/unionfs-fuse";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch
new file mode 100644
index 000000000000..0a98b83282b6
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch
@@ -0,0 +1,14 @@
+diff -ru -x '*~' unionfs-fuse-0.26-orig/src/unionfs.c unionfs-fuse-0.26/src/unionfs.c
+--- unionfs-fuse-0.26-orig/src/unionfs.c	2012-09-11 00:06:32.000000000 +0200
++++ unionfs-fuse-0.26/src/unionfs.c	2014-05-21 14:22:03.597861805 +0200
+@@ -831,6 +831,10 @@
+ 	}
+ #endif
+ 
++	/* Prevent systemd's shutdown from killing us. */
++	if (access("/etc/initrd-release", F_OK) >= 0)
++		argv[0][0] = '@';
++
+ 	umask(0);
+ 	int res = fuse_main(args.argc, args.argv, &unionfs_oper, NULL);
+ 	RETURN(uopt.doexit ? uopt.retval : res);
diff --git a/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix
new file mode 100644
index 000000000000..b60dccc4e68f
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, asciidoc
+, docbook_xsl
+, fuse
+, libuuid
+, libxslt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vmfs-tools";
+  version = "0.2.5.20160116";
+
+  src = fetchFromGitHub {
+    owner = "glandium";
+    repo = pname;
+    rev = "4ab76ef5b074bdf06e4b518ff6d50439de05ae7f";
+    sha256 = "14y412ww5hxk336ils62s3fwykfh6mx1j0iiaa5cwc615pi6qvi4";
+  };
+
+  nativeBuildInputs = [ asciidoc docbook_xsl libxslt pkg-config ];
+
+  buildInputs = [ fuse libuuid ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    install -Dm444 -t $out/share/doc/${pname} AUTHORS LICENSE README TODO
+  '';
+
+  meta = with lib; {
+    description = "FUSE-based VMFS (vmware) file system tools";
+    maintainers = with maintainers; [ peterhoeg ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    inherit (src.meta) homepage;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix b/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix
new file mode 100644
index 000000000000..29d8b4c2887b
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, glib, neon, fuse, autoreconfHook, pkg-config}:
+
+stdenv.mkDerivation rec {
+  pname = "wdfs-fuse";
+  version = "1.4.2";
+
+  src = fetchurl {
+    url = "http://noedler.de/projekte/wdfs/wdfs-${version}.tar.gz";
+    sha256 = "fcf2e1584568b07c7f3683a983a9be26fae6534b8109e09167e5dff9114ba2e5";
+  };
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [fuse glib neon];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # Fix the build on macOS with macFUSE installed. Needs autoreconfHook to
+    # take effect.
+    substituteInPlace configure.ac --replace \
+      'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' ""
+  '';
+
+  meta = with lib; {
+    homepage = "http://noedler.de/projekte/wdfs/";
+    license = licenses.gpl2Plus;
+    description = "User-space filesystem that allows to mount a webdav share";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/default.nix
new file mode 100644
index 000000000000..70c445014098
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/default.nix
@@ -0,0 +1,37 @@
+{lib, stdenv, fetchurl, zlib, ncurses, fuse}:
+
+stdenv.mkDerivation rec {
+  name = "wiimms-iso-tools";
+  version = "3.02a";
+
+  src = fetchurl {
+    url = "https://download.wiimm.de/source/wiimms-iso-tools/wiimms-iso-tools.source-${version}.tar.bz2";
+    sha256 = "074cvcaqz23xyihslc6n64wwxwcnl6xp7l0750yb9pc0wrqxmj69";
+  };
+
+  buildInputs = [ zlib ncurses fuse ];
+
+  patches = [ ./fix-paths.diff ];
+  postPatch = ''
+    patchShebangs setup.sh
+    patchShebangs gen-template.sh
+    patchShebangs gen-text-file.sh
+  '';
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=format-security";
+  INSTALL_PATH = "$out";
+
+  installPhase = ''
+    mkdir "$out"
+    patchShebangs install.sh
+    ./install.sh --no-sudo
+  '';
+
+  meta = with lib; {
+    homepage = "https://wit.wiimm.de";
+    description = "A set of command line tools to manipulate Wii and GameCube ISO images and WBFS containers";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nilp0inter ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/fix-paths.diff b/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/fix-paths.diff
new file mode 100644
index 000000000000..4a545e92a185
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/fix-paths.diff
@@ -0,0 +1,12 @@
+diff -r -u wiimms-iso-tools.source-3.02a.patched/setup.sh wiimms-iso-tools.source-3.02a/setup.sh
+--- wiimms-iso-tools.source-3.02a.patched/setup.sh	2020-06-02 23:48:18.651495869 +0200
++++ wiimms-iso-tools.source-3.02a/setup.sh	2020-06-02 23:48:29.758162513 +0200
+@@ -57,7 +57,7 @@
+ 
+ #--------------------------------------------------
+ 
+-INSTALL_PATH=/usr/local
++ INSTALL_PATH="$out"
+ 
+ if [[ -d $INSTALL_PATH/bin ]]
+ then
diff --git a/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix
new file mode 100644
index 000000000000..85efb13b82ef
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, buildPackages, fetchpatch, fetchurl, autoconf, automake, gettext, libtool, pkg-config
+, icu, libuuid, readline, inih
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xfsprogs";
+  version = "5.11.0";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/utils/fs/xfs/xfsprogs/${pname}-${version}.tar.xz";
+    sha256 = "0lxks616nmdk8zkdbwpq5sf9zz19smgy5rpmp3hpk2mvrl7kk70f";
+  };
+
+  outputs = [ "bin" "dev" "out" "doc" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [
+    autoconf automake libtool gettext pkg-config
+    libuuid # codegen tool uses libuuid
+  ];
+  buildInputs = [ readline icu inih ];
+  propagatedBuildInputs = [ libuuid ]; # Dev headers include <uuid/uuid.h>
+
+  enableParallelBuilding = true;
+
+  # @sbindir@ is replaced with /run/current-system/sw/bin to fix dependency cycles
+  preConfigure = ''
+    for file in scrub/{xfs_scrub_all.cron.in,xfs_scrub@.service.in,xfs_scrub_all.service.in}; do
+      substituteInPlace "$file" \
+        --replace '@sbindir@' '/run/current-system/sw/bin'
+    done
+    make configure
+    patchShebangs ./install-sh
+  '';
+
+  configureFlags = [
+    "--disable-lib64"
+    "--with-systemd-unit-dir=${placeholder "out"}/lib/systemd/system"
+  ];
+
+  installFlags = [ "install-dev" ];
+
+  # FIXME: forbidden rpath
+  postInstall = ''
+    find . -type d -name .libs | xargs rm -rf
+  '';
+
+  meta = with lib; {
+    homepage = "https://xfs.org/";
+    description = "SGI XFS utilities";
+    license = with licenses; [ gpl2Only lgpl21 gpl3Plus ];  # see https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/debian/copyright
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ dezgeg ajs124 ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix b/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix
new file mode 100644
index 000000000000..9c49c4677d2a
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix
@@ -0,0 +1,79 @@
+{ stdenv, boost, fuse, openssl, cmake, attr, jdk, ant, which, file, python
+, lib, valgrind, makeWrapper, fetchFromGitHub, fetchpatch }:
+
+stdenv.mkDerivation {
+  src = fetchFromGitHub {
+    # using unstable release because stable (v1.5.1) has broken repl java plugin
+    rev = "7ddcb081aa125b0cfb008dc98addd260b8353ab3";
+    owner = "xtreemfs";
+    repo = "xtreemfs";
+    sha256 = "1hjmd32pla27zf98ghzz6r5ml8ry86m9dsryv1z01kxv5l95b3m0";
+  };
+
+  pname = "XtreemFS";
+  version = "1.5.1.81";
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ which attr python ];
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/xtreemfs/xtreemfs/commit/ebfdc2fff56c09f310159d92026883941e42a953.patch";
+      sha256 = "075w00ad88qm6xpm5679m0gfzkrc53w17sk7ycybf4hzxjs29ygy";
+      name = "xtreemfs-fix-for-openssl_1_1";
+    })
+  ];
+
+  preConfigure = ''
+    export JAVA_HOME=${jdk}
+    export ANT_HOME=${ant}
+
+    export BOOST_INCLUDEDIR=${boost.dev}/include
+    export BOOST_LIBRARYDIR=${boost.out}/lib
+    export CMAKE_INCLUDE_PATH=${openssl.dev}/include
+    export CMAKE_LIBRARY_PATH=${openssl.out}/lib
+
+    substituteInPlace cpp/cmake/FindValgrind.cmake \
+      --replace "/usr/local" "${valgrind}"
+
+    substituteInPlace cpp/CMakeLists.txt \
+      --replace '"/lib64" "/usr/lib64"' '"${attr.out}/lib" "${fuse}/lib"'
+
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${fuse}/include"
+    export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L${fuse}/lib"
+
+    export DESTDIR=$out
+
+    substituteInPlace Makefile \
+      --replace "/usr/share/" "/share/" \
+      --replace 'BIN_DIR=$(DESTDIR)/usr/bin' "BIN_DIR=$out/bin"
+
+    substituteInPlace etc/init.d/generate_initd_scripts.sh \
+      --replace "/bin/bash" "${stdenv.shell}"
+
+    substituteInPlace cpp/thirdparty/gtest-1.7.0/configure \
+      --replace "/usr/bin/file" "${file}/bin/file"
+
+    substituteInPlace cpp/thirdparty/protobuf-2.5.0/configure \
+      --replace "/usr/bin/file" "${file}/bin/file"
+
+    substituteInPlace cpp/thirdparty/protobuf-2.5.0/gtest/configure \
+      --replace "/usr/bin/file" "${file}/bin/file"
+
+    # do not put cmake into buildInputs
+    export PATH="$PATH:${cmake}/bin"
+  '';
+
+  doCheck = false;
+
+  postInstall = ''
+    rm -r $out/sbin
+  '';
+
+  meta = {
+    description = "A distributed filesystem";
+    maintainers = with lib.maintainers; [ raskin matejc ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix b/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix
new file mode 100644
index 000000000000..d2779e2b4c59
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }:
+
+let
+  p = if stdenv.is64bit then {
+      arch = "x86_64";
+      gcclib = "${stdenv.cc.cc.lib}/lib64";
+      sha256 = "14bpc5ddhxvgfxkxhj5q9z443s7z4nn1zf4k1hxj7rbf13rcpg00";
+    }
+    else {
+      arch = "i386";
+      gcclib = "${stdenv.cc.cc.lib}/lib";
+      sha256 = "1s829q8gy9xgz0jm7w70aljqs2h49x402blqfr9zvn806aprmrm5";
+    };
+in
+stdenv.mkDerivation rec {
+
+  pname = "yandex-disk";
+  version = "0.1.5.1039";
+
+  src = fetchurl {
+    url = "https://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${pname}-${version}-1.fedora.${p.arch}.rpm";
+    sha256 = p.sha256;
+  };
+
+  builder = writeText "builder.sh" ''
+    . $stdenv/setup
+    mkdir -pv $out/bin
+    mkdir -pv $out/share
+    mkdir -pv $out/etc
+
+    mkdir -pv unpacked
+    cd unpacked
+    ${rpmextract}/bin/rpmextract $src
+
+    mkdir -p $out/share/bash-completion/completions
+    cp -r -t $out/bin usr/bin/*
+    cp -r -t $out/share usr/share/*
+    cp -r -t $out/share/bash-completion/completions etc/bash_completion.d/*
+
+    sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
+      $out/share/bash-completion/completions/yandex-disk-completion.bash
+
+    ${patchelf}/bin/patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${zlib.out}/lib:${p.gcclib}" \
+      $out/bin/yandex-disk
+  '';
+
+  meta = {
+    homepage = "https://help.yandex.com/disk/cli-clients.xml";
+    description = "A free cloud file storage service";
+    maintainers = with lib.maintainers; [ smironov jagajaga ];
+    platforms = ["i686-linux" "x86_64-linux"];
+    license = lib.licenses.unfree;
+    longDescription = ''
+      Yandex.Disk console client for Linux lets you manage files on Disk without
+      using a window interface or programs that support WebDAV. The advantages
+      of the console client compared to a WebDAV connection:
+       * low system resource requirements;
+       * faster file reading and writing speeds;
+       * faster syncing with Disk's server;
+       * no need to be constantly connected to work with files.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix b/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix
new file mode 100644
index 000000000000..1447ca36a136
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, installShellFiles, e2fsprogs }:
+
+let
+  manpage = fetchurl {
+    url = "https://manpages.ubuntu.com/manpages.gz/xenial/man8/zerofree.8.gz";
+    sha256 = "0y132xmjl02vw41k794psa4nmjpdyky9f6sf0h4f7rvf83z3zy4k";
+  };
+in stdenv.mkDerivation rec {
+  pname = "zerofree";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "https://frippery.org/uml/${pname}-${version}.tgz";
+    sha256 = "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm";
+  };
+
+  buildInputs = [ e2fsprogs installShellFiles ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/zerofree
+    cp zerofree $out/bin
+    cp COPYING $out/share/zerofree/COPYING
+    installManPage ${manpage}
+  '';
+
+  meta = {
+    homepage = "https://frippery.org/uml/";
+    description = "Zero free blocks from ext2, ext3 and ext4 file-systems";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.theuni ];
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix b/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix
new file mode 100644
index 000000000000..ecc4b1184867
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, ruby, zfs }:
+
+let version = "0.3.6"; in
+stdenv.mkDerivation rec {
+  pname = "zfstools";
+  inherit version;
+
+  src = fetchFromGitHub {
+    sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
+    rev = "v${version}";
+    repo = "zfstools";
+    owner = "bdrewery";
+  };
+
+  buildInputs = [ ruby ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/* $out/bin/
+
+    cp -R lib $out/
+
+    for f in $out/bin/*; do
+      substituteInPlace $f --replace "/usr/bin/env ruby" "ruby -I$out/lib"
+    done
+
+    sed -e 's|cmd.*=.*"zfs |cmd = "${zfs}/sbin/zfs |g' -i $out/lib/zfstools/{dataset,snapshot}.rb
+  '';
+
+  meta = with lib; {
+    inherit version;
+    inherit (src.meta) homepage;
+    description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
+    longDescription = ''
+      zfstools is an OpenSolaris-like and compatible auto snapshotting script
+      for ZFS, which also supports auto snapshotting mysql databases.
+    '';
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix
new file mode 100644
index 000000000000..456444f3bf59
--- /dev/null
+++ b/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, lib
+, autoreconfHook
+, gnused
+, boost
+, fuse
+, log4cxx
+, zookeeper
+, zookeeper_mt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zkfuse";
+  inherit (zookeeper_mt) version src;
+
+  sourceRoot = "apache-${zookeeper.pname}-${version}/zookeeper-contrib/zookeeper-contrib-zkfuse";
+
+  nativeBuildInputs = [ autoreconfHook gnused ];
+  buildInputs = [ zookeeper_mt log4cxx boost fuse ];
+
+  postPatch = ''
+    # Make the async API accessible, and use the proper include path.
+    sed -i src/zkadapter.h \
+        -e '/"zookeeper\.h"/i#define THREADED' \
+        -e 's,"zookeeper\.h",<zookeeper/zookeeper.h>,'
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -v src/zkfuse $out/bin
+  '';
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cstrahan ztzg ];
+    license = licenses.asl20;
+  };
+}