Created
July 4, 2025 12:22
-
-
Save tarneaux/7376d06f5e40d53a5b08dd37da6f376c to your computer and use it in GitHub Desktop.
Nixos AutoFS + sshfs minimum working setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs, ... }: | |
| { | |
| environment.systemPackages = [ | |
| pkgs.fuse | |
| pkgs.sshfs | |
| ]; | |
| services.autofs.enable = true; | |
| services.autofs.debug = true; | |
| services.autofs.autoMaster = let | |
| mappingFile = pkgs.writeText "autofs.sshfs" '' | |
| zk -fstype=fuse,user,rw,allow_other,IdentityFile=/home/tarneo/.ssh/id_ed25519,ServerAliveInterval=60,ServerAliveCountMax=10,reconnect,noatime :${pkgs.sshfs}/bin/sshfs\#tarneo@<server>\:zk | |
| ''; | |
| in '' | |
| /automount ${mappingFile} uid=1000,gid=1000,--timeout=10,--ghost | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment