1 { version, sha256, platforms, patches ? [ ] }:
3 { lib, stdenv, fetchFromGitHub
4 , meson, pkg-config, ninja, docutils, makeWrapper
5 , fuse3, macfuse-stubs, glib
6 , which, python3Packages
11 fuse = if stdenv.isDarwin then macfuse-stubs else fuse3;
12 in stdenv.mkDerivation rec {
16 src = fetchFromGitHub {
19 rev = "sshfs-${version}";
25 nativeBuildInputs = [ meson pkg-config ninja docutils makeWrapper ];
26 buildInputs = [ fuse glib ];
27 checkInputs = [ which python3Packages.pytest ];
29 NIX_CFLAGS_COMPILE = lib.optionalString
30 (stdenv.hostPlatform.system == "i686-linux")
31 "-D_FILE_OFFSET_BITS=64";
35 ln -sf $out/bin/sshfs $out/sbin/mount.sshfs
36 '' + lib.optionalString (!stdenv.isDarwin) ''
37 wrapProgram $out/bin/sshfs --prefix PATH : "${openssh}/bin"
41 checkPhase = lib.optionalString (!stdenv.isDarwin) ''
42 # The tests need fusermount:
44 cp ${fuse}/bin/fusermount3 bin/fusermount
46 # Can't access /dev/fuse within the sandbox: "FUSE kernel module does not seem to be loaded"
47 substituteInPlace test/util.py --replace "/dev/fuse" "/dev/null"
48 # TODO: "fusermount executable not setuid, and we are not root"
49 # We should probably use a VM test instead
50 ${python3Packages.python.interpreter} -m pytest test/
55 description = "FUSE-based filesystem that allows remote filesystems to be mounted over SSH";
56 longDescription = macfuse-stubs.warning;
57 homepage = "https://github.com/libfuse/sshfs";
58 license = licenses.gpl2Plus;
59 mainProgram = "sshfs";
60 maintainers = with maintainers; [ primeos ];