diff --git a/hosts/common/fs/fs-opts.nix b/hosts/common/fs/fs-opts.nix index 831e4d9b8..4c8f55430 100644 --- a/hosts/common/fs/fs-opts.nix +++ b/hosts/common/fs/fs-opts.nix @@ -11,6 +11,8 @@ rec { "x-systemd.requires=network-online.target" "x-systemd.after=network-online.target" "x-systemd.mount-timeout=10s" # how long to wait for mount **and** how long to wait for unmount + # disable defaults: don't fail local-fs.target if this mount fails + "nofail" ]; # x-systemd.automount: mount the fs automatically *on first access*. # creates a `path-to-mount.automount` systemd unit. @@ -35,6 +37,8 @@ rec { # - `allow_other` allows *any* local user to access the mount, and hence any local user can now freely become the remote mapped user. # with default_permissions, sshfs doesn't tunnel file ops from users until checking that said user could perform said op on an equivalent local fs. "default_permissions" + "drop_privileges" + "auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed. ]; fuseColin = fuse ++ [ "uid=1000" diff --git a/hosts/common/fs/remote-home.nix b/hosts/common/fs/remote-home.nix index 7249e5dab..b7e1b89c8 100644 --- a/hosts/common/fs/remote-home.nix +++ b/hosts/common/fs/remote-home.nix @@ -7,13 +7,7 @@ let mountpoint = "/mnt/${name}/home"; device = "sshfs#colin@${host}:/home/colin"; fsType = "fuse3"; - options = fsOpts.sshColin ++ fsOpts.lazyMount ++ [ - "drop_privileges" - "auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed. - # disable defaults: don't require this to be mount as part of local-fs.target - "noauto" - "nofail" - ]; + options = fsOpts.sshColin ++ fsOpts.lazyMount; in { sane.programs.sshfs-fuse.enableFor.system = true; system.fsPackages = [ diff --git a/hosts/common/fs/remote-servo.nix b/hosts/common/fs/remote-servo.nix index 49177f63c..8dd6e5358 100644 --- a/hosts/common/fs/remote-servo.nix +++ b/hosts/common/fs/remote-servo.nix @@ -6,13 +6,7 @@ let systemdName = utils.escapeSystemdPath mountpoint; device = "curlftpfs#ftp://servo-hn:/${subdir}"; fsType = "fuse3"; - commonOptions = fsOpts.ftp ++ fsOpts.noauto ++ [ - "drop_privileges" - "auto_unmount" #< ensures that when the fs exits, it releases its mountpoint. then systemd can recognize it as failed. - # disable defaults: don't require this to be mount as part of local-fs.target - "noauto" - "nofail" - ]; + commonOptions = fsOpts.ftp ++ fsOpts.noauto; options = commonOptions ++ [ # systemd (or maybe fuse?) swallows stderr of mount units with no obvious fix. # instead, use this flag to log the mount output to disk