hosts/common/fs: refactor

This commit is contained in:
2024-10-12 03:17:42 +00:00
parent 3685a27e8e
commit b60f7af59b
3 changed files with 6 additions and 14 deletions

View File

@@ -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"

View File

@@ -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 = [

View File

@@ -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