gnu: emacs-consult: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / file-systems.scm
index ce1155c..1a9e576 100644 (file)
@@ -1,9 +1,13 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
-;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2017, 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
-;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
+;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
+;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
+;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system go)
   #:use-module (guix build-system linux-module)
+  #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages acl)
   #:use-module (gnu packages attr)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages cyrus-sasl)
   #:use-module (gnu packages datastructures)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages golang)
+  #:use-module (gnu packages kerberos)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages nfs)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages openldap)
+  #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-crypto)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages rsync)
+  #:use-module (gnu packages sssd)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages valgrind)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages xml))
 
+(define-public autofs
+  (package
+    (name "autofs")
+    (version "5.1.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://kernel.org/linux/daemons/autofs/"
+                           "v" (version-major version) "/"
+                           "autofs-" version ".tar.xz"))
+       (sha256
+        (base32 "1myfz6a3wj2c4j9h5g44zj796fdi82jhp1s92w2hg6xp2632csx3"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--enable-ignore-busy"     ; during shutdown
+             "--enable-sloppy-mount"    ; support mount(8) -s
+             "--with-libtirpc"
+             (string-append "--with-openldap="
+                            (assoc-ref %build-inputs "openldap"))
+             (string-append "--with-sasl="
+                            (assoc-ref %build-inputs "cyrus-sasl"))
+             "HAVE_SSS_AUTOFS=1"        ; required to make sssldir click
+             (string-append "sssldir="
+                            (assoc-ref %build-inputs "sssd")
+                            "/lib/sssd/modules"))
+       #:tests? #f                      ; no test suite
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'fix-hard-coded-search-path
+           (lambda _
+             (substitute* "configure"
+               (("^searchpath=\".*\"")
+                "searchpath=\"$PATH\""))
+             #t))
+         (add-before 'configure 'fix-rpath
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "Makefile.rules"
+                 (("^AUTOFS_LIB_LINK.*=" match)
+                  (string-append match " -Wl,-rpath=" out "/lib"))))))
+         (add-before 'install 'omit-obsolete-lookup_nis.so-link
+           ;; Building lookup_yp.so depends on $(YPCLNT) but this doesn't,
+           ;; leading to a make error.  Since it's broken, comment it out.
+           (lambda _
+             (substitute* "modules/Makefile"
+               (("ln -fs lookup_yp.so" match)
+                (string-append "# " match)))
+             #t)))))
+    (native-inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)
+       ("pkg-config" ,pkg-config)
+       ("rpcsvc-proto" ,rpcsvc-proto)))
+    (inputs
+     `(("cyrus-sasl" ,cyrus-sasl)
+       ("e2fsprogs" ,e2fsprogs)         ; for e[234]fsck
+       ("libtirpc" ,libtirpc)
+       ("libxml2" ,libxml2)             ; needed for LDAP, SASL
+       ("mit-krb5" ,mit-krb5)           ; needed for LDAP, SASL
+       ("nfs-utils" ,nfs-utils)         ; for mount.nfs
+       ("openldap" ,openldap)
+       ("openssl" ,openssl)             ; needed for SASL
+       ("sssd" ,sssd)
+       ("util-linux" ,util-linux)))     ; for mount, umount
+    ;; XXX A directory index is the closest thing this has to a home page.
+    (home-page "https://www.kernel.org/pub/linux/daemons/autofs/")
+    (synopsis "Kernel-based automounter for Linux")
+    (description
+     "Autofs is a kernel-based automounter for use with the Linux autofs4
+module.  It automatically mounts selected file systems when they are used and
+unmounts them after a set period of inactivity.  This provides
+centrally-managed, consistent file names for users and applications, even in a
+large and/or frequently changing (network) environment.")
+    ;; fedfs/ is GPL-2-only but not built.
+    (license (list license:bsd-3        ; modules/cyrus-sasl.c
+                   license:gpl2+))))    ; the rest
+
+(define-public bindfs
+  (package
+    (name "bindfs")
+    (version "1.15.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://bindfs.org/downloads/bindfs-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "1av8dj9i1g0105fs5r9srqqsp7yahlhwc0yl8i1szyfdls23bp84"))))
+    (build-system gnu-build-system)
+    (arguments
+     ;; XXX: The tests have no hope of passing until there is a "nogroup"
+     ;; entry (or at least some group to which the guix builder does
+     ;; not belong) in the /etc/group file of the build environment.
+     ;; Currently we do not have such a group.  Disable tests for now.
+     '(#:tests? #f))
+    (native-inputs
+       ;; Native inputs to run the tests
+       ;; ("ruby" ,ruby)
+       ;; ("valgrind" ,valgrind)
+       ;; ("which" ,which)
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fuse" ,fuse)))
+    (home-page "https://bindfs.org")
+    (synopsis "Bind mount a directory and alter permission bits")
+    (description
+     "@command{bindfs} is a FUSE file system for mounting a directory to
+another location, similar to @command{mount --bind}.  It can be used for:
+@itemize
+@item Making a directory read-only.
+@item Making all executables non-executable.
+@item Sharing a directory with a list of users (or groups).
+@item Modifying permission bits using rules with chmod-like syntax.
+@item Changing the permissions with which files are created.
+@end itemize ")
+    (license license:gpl2+)))
+
+(define-public davfs2
+  (package
+    (name "davfs2")
+    (version "1.6.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://download.savannah.nongnu.org/releases/"
+                           "davfs2/davfs2-" version ".tar.gz"))
+       (sha256
+        (base32 "0l1vnv5lfigciwg17p10zxwhzj4qw2d9kw30prr7g4dxhmb6fsrf"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--sysconfdir=/etc"        ; so man pages & binaries contain /etc
+             (string-append "--docdir=" (assoc-ref %outputs "out")
+                            "/share/doc/" ,name "-" ,version)
+             (string-append "ssbindir=" (assoc-ref %outputs "out") "/sbin")
+             ;; The default ‘davfs2’ user and group don't exist on most systems.
+             "dav_user=nobody"
+             "dav_group=nogroup")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'omit-redundancy
+           ;; Don't install redundant copies of /etc examples into /share.
+           (lambda _
+             (substitute* "etc/Makefile.in"
+               (("(dist_pkgdata_DATA =.*) davfs2.conf secrets(.*)"
+                 _ prefix suffix)
+                (string-append prefix suffix)))
+             #t))
+         (add-after 'unpack 'patch-file-names
+           (lambda _
+             ;; Don't auto-load the FUSE kernel module.  That's up to root.
+             ;; XXX If/when we restore the previous behaviour, make sure not
+             ;; to introduce a security hole when mount.davfs is setuid.
+             (substitute* "src/kernel_interface.c"
+               (("/sbin/modprobe") "/modprobe/disabled"))
+             #t))
+         (replace 'install
+           (lambda* (#:key make-flags outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (apply invoke "make" "install"
+                      (string-append "pkgsysconfdir=" out "/etc")
+                      make-flags)))))))
+    (inputs
+     `(("neon" ,neon)
+
+       ;; Neon requires but doesn't propagate zlib, nor would we want that.
+       ;; XZ as well, but that's already present in the build environment.
+       ("zlib" ,zlib)))
+    (home-page "https://savannah.nongnu.org/projects/davfs2")
+    (synopsis "Mount remote WebDAV resources in the local file system")
+    (description
+     "The @acronym{WebDAV, Web Distributed Authoring and Versioning} extension
+to the HTTP protocol defines a standard way to author resources on a remote Web
+server.  Davfs2 exposes such resources as a typical file system which can be
+used by standard applications with no built-in support for WebDAV, such as the
+GNU coreutils (@command{cp}, @command{mv}, etc.) or a graphical word processor.
+
+Davfs2 works with most WebDAV servers with no or little configuration.  It
+supports TLS (HTTPS), HTTP proxies, HTTP basic and digest authentication, and
+client certificates.  It performs extensive caching to avoid unnecessary network
+traffic, stay responsive even over slow or unreliable connections, and prevent
+data loss.  It aims to make use by unprivileged users as easy and secure as
+possible.
+
+However, davfs2 is not a full-featured WebDAV client.  The file system interface
+and the WebDAV protocol are quite different.  Translating between the two is not
+always possible.")
+    (license (list license:bsd-2        ; src/fuse_kernel.h
+                   license:gpl3+))))    ; everything else
+
+(define-public fsarchiver
+  (package
+    (name "fsarchiver")
+    (version "0.8.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/fdupoux/fsarchiver")
+         (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ry2sdkfbg4bwcldk42g1i3wa3z4pr9yh9dil6ilhwcvhqiw41zc"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("bzip2" ,bzip2)
+       ("e2fsprogs" ,e2fsprogs)
+       ("libgcrypt" ,libgcrypt)
+       ("lz4" ,lz4)
+       ("lzo" ,lzo)
+       ("util-linux" ,util-linux "lib")
+       ("xz" ,xz)
+       ("zlib" ,zlib)
+       ("zstd:lib" ,zstd "lib")))
+    (synopsis "File system back-up, deployment, and migration tool")
+    (description
+     "FSArchiver saves the contents of a file system to a compressed archive
+file, and restores it to a different file system and/or partition.  This
+partition can be of a different size than the original and FSArchiver will
+create a new file system if none exists.
+
+All standard file attributes supported by the kernel are preserved, including
+file permissions, timestamps, symbolic and hard links, and extended attributes.
+
+Each file in the archive is protected by a checksum.  If part of the archive
+is corrupted you'll lose the affected file(s) but not the whole back-up.")
+    (home-page "https://www.fsarchiver.org/")
+    (license license:gpl2)))
+
+(define-public gphotofs
+  (package
+    (name "gphotofs")
+    (version "0.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "mirror://sourceforge/gphoto/gphotofs/" version
+                       "/gphotofs-0.5.tar.gz"))
+       (sha256
+        (base32
+         "04slwhr6ap9xcc27wphk22ad8yn79ngyy5z10lxams3k5liahvc2"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fuse" ,fuse)
+       ("glib" ,glib)
+       ("libgphoto2" ,libgphoto2)))
+    (synopsis "Virtual file system for libgphoto2 using FUSE")
+    (description "GPhotoFS is a FUSE file system module to mount your camera as
+a file system on Linux.  This allow using your camera with any tool able to read
+from a mounted file system.")
+    (home-page "http://www.gphoto.org/proj/gphotofs/")
+    (license license:gpl2+)))
+
 (define-public bcachefs-tools
-  (let ((commit "ab2f1ec24f5307b0cf1e3c4ad19bf350d9f54d9f")
-        (revision "0"))
+  (let ((commit "ce906d661e63d4318b9f26ec145f2ff5fddf5162")
+        (revision "5"))
     (package
       (name "bcachefs-tools")
       (version (git-version "0.1" revision commit))
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
-          (base32 "10pafvaxg1lvwnqjv3a4rsi96bghbpcsgh3vhqilndi334k3b0hd"))))
+          (base32 "1fkfqrk3q6shjr8jnpf3myd79xdpc8hbs0grwdmzb3dhw65k9isi"))))
       (build-system gnu-build-system)
       (arguments
        `(#:make-flags
-         (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+         (list ,(string-append "VERSION=" version) ; bogus vX.Y-nogit otherwise
+               (string-append "PREFIX=" (assoc-ref %outputs "out"))
                "INITRAMFS_DIR=$(PREFIX)/share/initramfs-tools"
                "CC=gcc"
                "PYTEST=pytest")
          #:phases
          (modify-phases %standard-phases
-           (delete 'configure))         ; no configure script
+           (delete 'configure)          ; no configure script
+           (add-after 'install 'promote-mount.bcachefs.sh
+             ;; XXX The (optional) mount.bcachefs helper requires rust:cargo.
+             ;; This alternative shell script does the job well enough for now.
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+               (with-directory-excursion (string-append out "/sbin")
+                 (rename-file "mount.bcachefs.sh" "mount.bcachefs")
+                 ;; WRAP-SCRIPT causes bogus ‘Insufficient arguments’ errors.
+                 (wrap-program "mount.bcachefs"
+                   `("PATH" ":" prefix
+                     ,(cons (string-append out "/sbin")
+                            (map (lambda (input)
+                                     (string-append (assoc-ref inputs input)
+                                                    "/bin"))
+                                   (list "coreutils"
+                                         "gawk"
+                                         "util-linux"))))))))))
          #:tests? #f))                  ; XXX 6 valgrind tests fail
       (native-inputs
        `(("pkg-config" ,pkg-config)
          ("python-pytest" ,python-pytest)
          ("valgrind" ,valgrind)))
       (inputs
-       `(("keyutils" ,keyutils)
+       `(("eudev" ,eudev)
+         ("keyutils" ,keyutils)
          ("libaio" ,libaio)
          ("libscrypt" ,libscrypt)
          ("libsodium" ,libsodium)
          ("liburcu" ,liburcu)
-         ("util-linux" ,util-linux)     ; lib{blkid,uuid}
+         ("util-linux:lib" ,util-linux "lib") ; lib{blkid,uuid}
          ("lz4" ,lz4)
          ("zlib" ,zlib)
-         ("zstd:lib" ,zstd "lib")))
+         ("zstd:lib" ,zstd "lib")
+
+         ;; Only for mount.bcachefs.sh.
+         ("coreutils" ,coreutils-minimal)
+         ("gawk" ,gawk)
+         ("util-linux" ,util-linux)))
       (home-page "https://bcachefs.org/")
       (synopsis "Tools to create and manage bcachefs file systems")
       (description
@@ -113,6 +420,86 @@ caching system, and lets you assign different roles to each device based on its
 performance and other characteristics.")
       (license license:gpl2+))))
 
+(define-public bcachefs-tools/static
+   (package
+     (inherit bcachefs-tools)
+     (name "bcachefs-tools-static")
+     (arguments
+      (substitute-keyword-arguments (package-arguments bcachefs-tools)
+        ((#:make-flags make-flags)
+         `(append ,make-flags
+                  (list "LDFLAGS=-static")))))
+     (inputs
+      `(("eudev:static" ,eudev "static")
+        ("libscrypt:static" ,libscrypt "static")
+        ("lz4:static" ,lz4 "static")
+        ("util-linux:static" ,util-linux "static") ; lib{blkid,uuid}
+        ("zlib" ,zlib "static")
+        ("zstd:static" ,zstd "static")
+        ,@(package-inputs bcachefs-tools)))))
+
+(define-public bcachefs/static
+  (package
+    (name "bcachefs-static")
+    (version (package-version bcachefs-tools))
+    (build-system trivial-build-system)
+    (source #f)
+    (inputs
+     `(("bcachefs-tools" ,bcachefs-tools/static)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils)
+                      (ice-9 ftw)
+                      (srfi srfi-26))
+         (let* ((bcachefs-tools (assoc-ref %build-inputs "bcachefs-tools"))
+                (out (assoc-ref %outputs "out")))
+           (mkdir-p out)
+           (with-directory-excursion out
+             (install-file (string-append bcachefs-tools
+                                          "/sbin/bcachefs")
+                           "sbin")
+             (remove-store-references "sbin/bcachefs")
+             (invoke "sbin/bcachefs" "version") ; test suite
+             #t)))))
+    (home-page (package-home-page bcachefs-tools))
+    (synopsis "Statically-linked bcachefs command from bcachefs-tools")
+    (description "This package provides the statically-linked @command{bcachefs}
+from the bcachefs-tools package.  It is meant to be used in initrds.")
+    (license (package-license bcachefs-tools))))
+
+(define-public exfatprogs
+  (package
+    (name "exfatprogs")
+    (version "1.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/exfatprogs/exfatprogs")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1ciy28lx7c1vr1f138qi0mkz88pzlkay6nlwmp1yjzd830x48549"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       (list "--disable-static")))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (home-page "https://github.com/exfatprogs/exfatprogs")
+    (synopsis "Tools to create, check, and repair exFAT file systems")
+    (description
+     "These are command-line user space tools for the @acronym{exFAT,
+Extensible File Allocation Table} file systems.  Included are
+@command{mkfs.exfat} to create (format) new exFAT file systems, and
+@command{fsck.exfat} to check their consistency and repair them.")
+    (license license:gpl2+)))
+
 (define-public httpfs2
   (package
     (name "httpfs2")
@@ -186,7 +573,7 @@ single file can be mounted.")
                                 "jfsutils-include-systypes.patch"))))
     (build-system gnu-build-system)
     (inputs
-     `(("util-linux" ,util-linux)))
+     `(("util-linux" ,util-linux "lib")))
     (home-page "http://jfs.sourceforge.net/home.html")
     (synopsis "Utilities for managing JFS file systems")
     (description
@@ -249,7 +636,7 @@ from the jfsutils package.  It is meant to be used in initrds.")
 (define-public disorderfs
   (package
     (name "disorderfs")
-    (version "0.5.9")
+    (version "0.5.11")
     (source
      (origin
        (method git-fetch)
@@ -259,7 +646,7 @@ from the jfsutils package.  It is meant to be used in initrds.")
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0irgr9hkm9icx1s44m9382484yx8hddzjxbsz621ip9c946pif0g"))))
+         "1pnrj0h8sgqwgsc18vz3fkqsp6vhigdbi75vdj0si1r6wgslnr7z"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
@@ -316,8 +703,8 @@ non-determinism in the build process.")
            (lambda _ (invoke "./autogen.sh"))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("libtirpc"libtirpc)
-       ("rpcsvc-proto"rpcsvc-proto)
+       ("libtirpc" ,libtirpc)
+       ("rpcsvc-proto" ,rpcsvc-proto)
        ("python-2" ,python-2) ; must be version 2
        ("flex" ,flex)
        ("bison" ,bison)
@@ -327,15 +714,15 @@ non-determinism in the build process.")
        ("cmocka" ,cmocka)))
     (inputs
      `(("acl" ,acl)
-       ("fuse"fuse)
+       ("fuse" ,fuse)
        ("openssl" ,openssl)
        ("liburcu" ,liburcu)
-       ("libuuid" ,util-linux)
+       ("libuuid" ,util-linux "lib")
        ("libxml2" ,libxml2)
        ("readline" ,readline)
        ("zlib" ,zlib)
-       ("libaio"libaio)
-       ("rdma-core"rdma-core)))
+       ("libaio" ,libaio)
+       ("rdma-core" ,rdma-core)))
     (home-page "https://www.gluster.org")
     (synopsis "Distributed file system")
     (description "GlusterFS is a distributed scalable network file system
@@ -388,7 +775,7 @@ All of this is accomplished without a centralized metadata server.")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/sahlberg/libnfs.git")
+                    (url "https://github.com/sahlberg/libnfs")
                     (commit (string-append "libnfs-" version))))
               (file-name (git-file-name name version))
               (sha256
@@ -417,8 +804,9 @@ network.  LIBNFS offers three different APIs, for different use :
                    ))))
 
 (define-public apfs-fuse
-  (let ((commit "c7036a3030d128bcecefc1eabc47c039ccfdcec9")
-        (revision "0"))
+  ;; Later versions require FUSE 3.
+  (let ((commit "7b89418e8dc27103d3c4f8fa348086ffcd634c17")
+        (revision "1"))
     (package
       (name "apfs-fuse")
       (version (git-version "0.0.0" revision commit))
@@ -430,11 +818,13 @@ network.  LIBNFS offers three different APIs, for different use :
                        (commit commit)))
          (sha256
           (base32
-           "1akd4cx1f9cyq6sfk9ybv4chhjwjlnqi8ic4z5ajnd5x0g76nz3r"))
+           "0x2siy3cmnm9wsdfazg3xc8r3kbg73gijmnn1vjw33pp71ckylxr"))
          (file-name (git-file-name name version))))
       (build-system cmake-build-system)
       (arguments
        `(#:tests? #f ; No test suite
+         #:configure-flags
+         '("-DUSE_FUSE3=OFF") ; FUSE 3 is not packaged yet.
          #:phases
          (modify-phases %standard-phases
            ;; No 'install' target in CMakeLists.txt
@@ -449,6 +839,7 @@ network.  LIBNFS offers three different APIs, for different use :
                  (install-file "apfs-dump-quick" bin)
                  (install-file "apfs-fuse" bin)
                  (install-file "libapfs.a" lib)
+                 (install-file "../source/README.md" doc)
                  #t))))))
       (inputs
        `(("bzip2" ,bzip2)
@@ -465,7 +856,7 @@ APFS.")
 (define-public zfs
   (package
     (name "zfs")
-    (version "0.8.2")
+    (version "2.0.4")
     (outputs '("out" "module" "src"))
     (source
       (origin
@@ -474,8 +865,7 @@ APFS.")
                               "/download/zfs-" version
                               "/zfs-" version ".tar.gz"))
           (sha256
-           (base32
-            "1f7aig15q3z832pr2n48j3clafic2yk1vvqlh28vpklfghjqwq27"))))
+           (base32 "0v2zshimz5miyj8mbskb52pnzyl1s4rhpr6208zq549v8g2l84vx"))))
     (build-system linux-module-build-system)
     (arguments
      `(;; The ZFS kernel module should not be downloaded since the license
@@ -489,8 +879,7 @@ APFS.")
            (lambda* (#:key outputs inputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (substitute* "configure"
-                 (("-/bin/sh") (string-append "-" (which "sh")))
-                 ((" /bin/sh") (string-append " " (which "sh"))))
+                 (("-/bin/sh") (string-append "-" (which "sh"))))
                (invoke "./configure"
                        "--with-config=all"
                        (string-append "--prefix=" out)
@@ -505,16 +894,33 @@ APFS.")
              (let ((out        (assoc-ref outputs "out"))
                    (src        (assoc-ref outputs "src"))
                    (util-linux (assoc-ref inputs "util-linux"))
-                   (nfs-utils  (assoc-ref inputs "nfs-utils")))
-               (substitute* "module/zfs/zfs_ctldir.c"
+                   (nfs-utils  (assoc-ref inputs "nfs-utils"))
+                   (kmod       (assoc-ref inputs "kmod-runtime")))
+               (substitute* "etc/Makefile.in"
+                 ;; This just contains an example configuration file for
+                 ;; configuring ZFS on traditional init systems, skip it
+                 ;; since we cannot use it anyway; the install target becomes
+                 ;; misdirected.
+                 (("= default ") "= "))
+               (substitute* "lib/libzfs/os/linux/libzfs_util_os.c"
+                 ;; Use path to /gnu/store/*-kmod in actual path that is exec'ed.
+                 (("\"/sbin/modprobe\"")
+                  (string-append "\"" kmod "/bin/modprobe" "\""))
+                 ;; Just use 'modprobe' in message to user, since Guix
+                 ;; does not have a traditional /sbin/
+                 (("'/sbin/modprobe ") "'modprobe "))
+               (substitute* "contrib/Makefile.in"
+                 ;; This is not configurable nor is its hard-coded /usr prefix.
+                 ((" initramfs") ""))
+               (substitute* "module/os/linux/zfs/zfs_ctldir.c"
                  (("/usr/bin/env\", \"umount")
                   (string-append util-linux "/bin/umount\", \"-n"))
                  (("/usr/bin/env\", \"mount")
                   (string-append util-linux "/bin/mount\", \"-n")))
-               (substitute* "lib/libzfs/libzfs_mount.c"
+               (substitute* "lib/libzfs/os/linux/libzfs_mount_os.c"
                  (("/bin/mount") (string-append util-linux "/bin/mount"))
                  (("/bin/umount") (string-append util-linux "/bin/umount")))
-               (substitute* "lib/libshare/nfs.c"
+               (substitute* "lib/libshare/os/linux/nfs.c"
                  (("/usr/sbin/exportfs")
                   (string-append nfs-utils "/sbin/exportfs")))
                (substitute* "config/zfs-build.m4"
@@ -532,7 +938,9 @@ APFS.")
                (substitute* "contrib/pyzfs/Makefile.in"
                  ((".*install-lib.*") ""))
                (substitute* '("Makefile.am" "Makefile.in")
-                 (("\\$\\(prefix)/src") (string-append src "/src"))))
+                 (("\\$\\(prefix)/src") (string-append src "/src")))
+               (substitute* (find-files "udev/rules.d/" ".rules.in$")
+                 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))))
              #t))
          (replace 'build
            (lambda _ (invoke "make")))
@@ -549,13 +957,14 @@ APFS.")
                        "INSTALL_MOD_STRIP=1")
                (install-file "contrib/bash_completion.d/zfs"
                              (string-append out "/share/bash-completion/completions"))
-               (symlink "../share/pkgconfig/" (string-append out "/lib/pkgconfig"))
                #t))))))
     (native-inputs
      `(("attr" ,attr)
+       ("kmod" ,kmod)
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("eudev" ,eudev)
+       ("kmod-runtime" ,kmod)
        ("libaio" ,libaio)
        ("libtirpc" ,libtirpc)
        ("nfs-utils" ,nfs-utils)
@@ -563,11 +972,236 @@ APFS.")
        ("python" ,python)
        ("python-cffi" ,python-cffi)
        ("util-linux" ,util-linux)
+       ("util-linux:lib" ,util-linux "lib")
        ("zlib" ,zlib)))
     (home-page "https://zfsonlinux.org/")
-    (synopsis "Native ZFS on Linux")
+    (synopsis "OpenZFS on Linux")
     (description
-     "ZFS on Linux is an advanced file system and volume manager which was
+     "OpenZFS is an advanced file system and volume manager which was
 originally developed for Solaris and is now maintained by the OpenZFS
 community.")
     (license license:cddl1.0)))
+
+(define-public mergerfs
+  (package
+    (name "mergerfs")
+    (version "2.32.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/trapexit/mergerfs/releases/download/"
+                           version "/mergerfs-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0yz7nljx6axcj6hb09sgc0waspgfhp535228rjqvqgyd8y74jc3s"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f                      ; No tests exist.
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'fix-paths
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (setenv "CC" "gcc")
+             ;; These were copied from the package libfuse.
+             (substitute* '("libfuse/lib/mount_util.c" "libfuse/util/mount_util.c")
+               (("/bin/(u?)mount" _ maybe-u)
+                (string-append (assoc-ref inputs "util-linux")
+                               "/bin/" maybe-u "mount")))
+             (substitute* '("libfuse/util/mount.mergerfs.c")
+               (("/bin/sh")
+                (which "sh")))
+             ;; The Makefile does not allow overriding PREFIX via make variables.
+             (substitute* '("Makefile" "libfuse/Makefile")
+               (("= /usr/local") (string-append "= " (assoc-ref outputs "out")))
+               (("= /sbin") "= $(EXEC_PREFIX)/sbin")
+               ;; cannot chown as build user
+               (("chown root(:root)?") "true"))
+             #t)))))
+    ;; mergerfs bundles a heavily modified copy of libfuse.
+    (inputs `(("util-linux" ,util-linux)))
+    (home-page "https://github.com/trapexit/mergerfs")
+    (synopsis "Featureful union file system")
+    (description "mergerfs is a union file system geared towards simplifying
+storage and management of files across numerous commodity storage devices.  It
+is similar to mhddfs, unionfs, and aufs.")
+    (license (list
+              license:isc                   ; mergerfs
+              license:gpl2 license:lgpl2.0  ; Imported libfuse code.
+              ))))
+
+(define-public mergerfs-tools
+  (let ((commit "480296ed03d1c3c7909697d7ef96d35840ee26b8")
+        (revision "2"))
+    (package
+      (name "mergerfs-tools")
+      ;; No released version exists.
+      (version (git-version "0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/trapexit/mergerfs-tools")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0xr06gi4xcr832rzy0hkp5c1n231s7w5iq1nkjvx9kvm0dl7chpq"))))
+      (build-system copy-build-system)
+      (inputs
+       `(("python" ,python)
+         ("python-xattr" ,python-xattr)
+         ("rsync" ,rsync)))
+      (arguments
+       '(#:install-plan
+         '(("src/" "bin/"))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'patch-paths
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* (find-files "src" "^mergerfs\\.")
+                 (("'rsync'")
+                  (string-append "'" (assoc-ref inputs "rsync") "/bin/rsync'"))
+                 (("'rm'")
+                  (string-append "'" (assoc-ref inputs "coreutils") "/bin/rm'")))
+               (substitute* "src/mergerfs.mktrash"
+                 (("xattr")
+                  (string-append (assoc-ref inputs "python-xattr") "/bin/xattr"))
+                 (("mkdir")
+                  (string-append (assoc-ref inputs "coreutils") "/bin/mkdir")))
+               #t)))))
+      (synopsis "Tools to help manage data in a mergerfs pool")
+      (description "mergerfs-tools is a suite of programs that can audit
+permissions and ownership of files and directories on a mergerfs volume,
+duplicates files and directories across branches in its pool, find and remove
+duplicate files, balance pool drives, consolidate files in a single mergerfs
+directory onto a single drive and create FreeDesktop.org Trash specification
+compatible directories.")
+      (home-page "https://github.com/trapexit/mergerfs-tools")
+      (license license:isc))))
+
+(define-public python-dropbox
+  (package
+    (name "python-dropbox")
+    (version "11.5.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "dropbox" version))
+        (sha256
+         (base32
+          "16bxx9xqx2s4d9khrw57a0bj4q7nc6kq355wl4pfddn9cqvh9rg2"))))
+    (build-system python-build-system)
+    (arguments '(#:tests? #f))  ; Tests require a network connection.
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-runner" ,python-pytest-runner)))
+    (propagated-inputs
+     `(("python-certifi" ,python-certifi)
+       ("python-chardet" ,python-chardet)
+       ("python-requests" ,python-requests)
+       ("python-six" ,python-six)
+       ("python-stone" ,python-stone)
+       ("python-urllib3" ,python-urllib3)))
+    (home-page "https://www.dropbox.com/developers")
+    (synopsis "Official Dropbox API Client")
+    (description "This package provides a Python SDK for integrating with the
+Dropbox API v2.")
+    (license license:expat)))
+
+(define-public dbxfs
+  (package
+    (name "dbxfs")
+    (version "1.0.51")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "dbxfs" version))
+        (sha256
+         (base32
+          "1zz82d0mnql55397x4jx7z5rn857rf9zhjv895j93wpxdq10xwvk"))
+        (patches (search-patches "dbxfs-remove-sentry-sdk.patch"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f)) ; tests requires safefs
+    (propagated-inputs
+     `(("python-appdirs" ,python-appdirs)
+       ("python-block-tracing" ,python-block-tracing)
+       ("python-dropbox" ,python-dropbox)
+       ("python-keyring" ,python-keyring)
+       ("python-keyrings.alt" ,python-keyrings.alt)
+       ("python-privy" ,python-privy)
+       ("python-userspacefs" ,python-userspacefs)))
+  (home-page "https://github.com/rianhunter/dbxfs")
+  (synopsis "User-space file system for Dropbox")
+  (description
+   "@code{dbxfs} allows you to mount your Dropbox folder as if it were a
+local file system using FUSE.")
+  (license license:gpl3+)))
+
+(define-public go-github-com-hanwen-fuse
+  (package
+    (name "go-github-com-hanwen-fuse")
+    (version "2.0.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hanwen/go-fuse")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1y44d08fxyis99s6jxdr6dbbw5kv3wb8lkhq3xmr886i4w41lz03"))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "github.com/hanwen/go-fuse"))
+    (propagated-inputs
+     `(("go-golang-org-x-sys" ,go-golang-org-x-sys)))
+    (home-page "https://github.com/hanwen/go-fuse")
+    (synopsis "FUSE bindings for Go")
+    (description
+     "This package provides Go native bindings for the FUSE kernel module.")
+    (license license:bsd-3)))
+
+(define-public tmsu
+  (package
+    (name "tmsu")
+    (version "0.7.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/oniony/TMSU")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0834hah7p6ad81w60ifnxyh9zn09ddfgrll04kwjxwp7ypbv38wq"))))
+    (build-system go-build-system)
+    (arguments
+     `(#:import-path "github.com/oniony/TMSU"
+       #:unpack-path ".."
+       #:install-source? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'post-install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               ;; The go build system produces /bin/TMSU -> install as /bin/tmsu
+               (rename-file (string-append out "/bin/TMSU")
+                            (string-append out "/bin/tmsu"))))))))
+    (inputs
+     `(("go-github-com-mattn-go-sqlite3" ,go-github-com-mattn-go-sqlite3)
+       ("go-github-com-hanwen-fuse" ,go-github-com-hanwen-fuse)))
+    (home-page "https://github.com/oniony/TMSU")
+    (synopsis "Tag files and access them through a virtual file system")
+    (description
+     "TMSU is a tool for tagging your files.  It provides a simple
+command-line utility for applying tags and a virtual file system to give you a
+tag-based view of your files from any other program.  TMSU does not alter your
+files in any way: they remain unchanged on disk, or on the network, wherever
+your put them.  TMSU maintains its own database and you simply gain an
+additional view, which you can mount where you like, based upon the tags you
+set up.")
+    (license license:gpl3+)))