Skip to content

Commit

Permalink
Auto reconnect sshfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Defelo committed Dec 18, 2023
1 parent 0eec641 commit 1358202
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/sshfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
default = false;
};

reconnect = mkOption {
type = types.bool;
default = true;
};

options = mkOption {
type = types.listOf types.str;
default = [];
Expand All @@ -61,13 +66,15 @@
options,
readOnly,
allowOther,
reconnect,
}: {
fsType = "fuse.sshfs";
device = "${user}@${host}:${path}";
options =
["_netdev" "port=${toString port}"]
++ (lib.optional readOnly "ro")
++ (lib.optional allowOther "allow_other")
++ (lib.optional reconnect "reconnect")
++ options;
})
cfg.mounts;
Expand Down

0 comments on commit 1358202

Please sign in to comment.