hosts/common/fs: refactor
This commit is contained in:
@@ -11,6 +11,8 @@ rec {
|
|||||||
"x-systemd.requires=network-online.target"
|
"x-systemd.requires=network-online.target"
|
||||||
"x-systemd.after=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
|
"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*.
|
# x-systemd.automount: mount the fs automatically *on first access*.
|
||||||
# creates a `path-to-mount.automount` systemd unit.
|
# 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.
|
# - `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.
|
# 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"
|
"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 ++ [
|
fuseColin = fuse ++ [
|
||||||
"uid=1000"
|
"uid=1000"
|
||||||
|
@@ -7,13 +7,7 @@ let
|
|||||||
mountpoint = "/mnt/${name}/home";
|
mountpoint = "/mnt/${name}/home";
|
||||||
device = "sshfs#colin@${host}:/home/colin";
|
device = "sshfs#colin@${host}:/home/colin";
|
||||||
fsType = "fuse3";
|
fsType = "fuse3";
|
||||||
options = fsOpts.sshColin ++ fsOpts.lazyMount ++ [
|
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"
|
|
||||||
];
|
|
||||||
in {
|
in {
|
||||||
sane.programs.sshfs-fuse.enableFor.system = true;
|
sane.programs.sshfs-fuse.enableFor.system = true;
|
||||||
system.fsPackages = [
|
system.fsPackages = [
|
||||||
|
@@ -6,13 +6,7 @@ let
|
|||||||
systemdName = utils.escapeSystemdPath mountpoint;
|
systemdName = utils.escapeSystemdPath mountpoint;
|
||||||
device = "curlftpfs#ftp://servo-hn:/${subdir}";
|
device = "curlftpfs#ftp://servo-hn:/${subdir}";
|
||||||
fsType = "fuse3";
|
fsType = "fuse3";
|
||||||
commonOptions = fsOpts.ftp ++ fsOpts.noauto ++ [
|
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"
|
|
||||||
];
|
|
||||||
options = commonOptions ++ [
|
options = commonOptions ++ [
|
||||||
# systemd (or maybe fuse?) swallows stderr of mount units with no obvious fix.
|
# systemd (or maybe fuse?) swallows stderr of mount units with no obvious fix.
|
||||||
# instead, use this flag to log the mount output to disk
|
# instead, use this flag to log the mount output to disk
|
||||||
|
Reference in New Issue
Block a user