From 4486975542f47f090b5f9bb57d634148005ce5aa Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 14 Dec 2022 10:26:24 +0100 Subject: ... --- hosts/vidhar/samba.nix | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'hosts/vidhar/samba.nix') diff --git a/hosts/vidhar/samba.nix b/hosts/vidhar/samba.nix index 506edaae..af1581c5 100644 --- a/hosts/vidhar/samba.nix +++ b/hosts/vidhar/samba.nix @@ -61,22 +61,31 @@ interface = [ "lo" "lan" ]; }; - fileSystems."/srv/eos.lower" = { - device = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/base"; - fsType = "ntfs"; - options = [ "ro" "uid=mherold" "gid=users" "fmask=0177" "dmask=0077" "nofail" "noauto" ]; - }; + systemd.mounts = [ + { + where = "/srv/eos.lower"; + what = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/base"; + type = "ntfs"; + options = lib.concatStringsSep "," + [ "ro" + "uid=mherold" "gid=users" "fmask=0177" "dmask=0077" + "nofail" + ]; - fileSystems."/srv/eos.upper" = { - device = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/upper"; - fsType = "ext4"; - options = [ "nofail" "noauto" ]; - }; + unitConfig.StopWhenUnneeded = true; + } + { + where = "/srv/eos.upper"; + what = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/upper"; + type = "ext4"; + options = lib.concatStringsSep "," + [ "nofail" + ]; - systemd.mounts = [ + unitConfig.StopWhenUnneeded = true; + } { - wantedBy = [ "samba-smbd.service" ]; - before = [ "samba-smbd.service" ]; + bindsTo = [ "srv-eos.lower.mount" "srv-eos.upper.mount" ]; where = "/srv/eos"; what = "overlay"; @@ -86,10 +95,16 @@ "upperdir=/srv/eos.upper/upper" "workdir=/srv/eos.upper/work" ]; + } + ]; + systemd.automounts = [ + { + wantedBy = [ "samba-smbd.service" ]; + before = [ "samba-smbd.service" ]; - unitConfig = { - RequiresMountsFor = [ "/srv/eos.lower" "/srv/eos.upper" ]; - }; + where = "/srv/eos"; + + automountConfig.TimeoutIdleSec = "5m"; } ]; }; -- cgit v1.2.3