Remote mounting of file system (autofs/something else?)

Is there a declarative way or some service to mount remote filesystems via sshfs or something similar? I have a server with a folder I wish to mount on my local machine.

I’m looking into autofs at the moment, but I’m not sure if it’s the right thing or not.

My server has ssh and sftp setup - so either is possible.

I believe fstab supports sshfs, so you might be able to specify it with the fileSystems option. Alternatively, a systemd unit that runs the sshfs command. Nfs is another option. I use syncthing if I want access offline.

1 Like

You are right, it does support sshfs.

I ended up following NFS - NixOS Wiki for general options of mounting remote filesystems (just with sshfs), and then for the parameters to pass into options.