nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix
Rickard Nilsson 7870db8b10 unionfs: Add mount helper (mount.unionfs-fuse)
This makes it possible to mount unionfs directly with mount or fstab.

Example fstab entry:

  none /mnt/union unionf-fuse allow-other,dirs=/source1=RW,/source2=RW

Note, the dirs= option need to be the last option, due to limitations
in the mount helper provided by unionfs-fuse. Maybe we should write a
better helper ourselves.

Also, you need to specify your branches as dirs= option, NOT as
the device, since the latest version of libmount always interprets
"=" characters in the device name as a tag (like LABEL, UUID etc)
and will try to resolve the tag before calling the mount helper.
This will of course not succeed and the mount will fail.
2013-04-09 16:36:38 +02:00

33 lines
1.1 KiB
Nix

{ stdenv, fetchurl, cmake, fuse }:
stdenv.mkDerivation rec {
name = "unionfs-fuse-0.26";
src = fetchurl {
url = "http://podgorny.cz/unionfs-fuse/releases/${name}.tar.xz";
sha256 = "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d";
};
buildInputs = [ cmake 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 = ''
ensureDir $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 = {
description = "FUSE UnionFS implementation";
homepage = http://podgorny.cz/moin/UnionFsFuse;
license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.shlevy ];
};
}