From b01273e1dda369f1f6f8ea6d4978d2254cab480c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 29 Dec 2022 19:35:55 +0100 Subject: ... --- hosts/vidhar/zfs.nix | 46 ++++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/hosts/vidhar/zfs.nix b/hosts/vidhar/zfs.nix index 7689776b..afb155b2 100644 --- a/hosts/vidhar/zfs.nix +++ b/hosts/vidhar/zfs.nix @@ -96,36 +96,26 @@ # fsType = "zfs"; # options = [ "zfsutil" ]; # }; - - "/home/mherold/camera/2020-09-13" = - { device = "/dev/zvol/hdd-raid6/safe/home/mherold/camera/2020-09-13"; - fsType = "vfat"; - options = [ "uid=mherold" "gid=users" "x-systemd.automount" "x-systemd.idle-timeout=120" ]; - noCheck = true; - }; - - "/home/mherold/camera/2022-01-16" = - { device = "/dev/zvol/hdd-raid6/safe/home/mherold/camera/2022-01-16"; - fsType = "vfat"; - options = [ "uid=mherold" "gid=users" "x-systemd.automount" "x-systemd.idle-timeout=120" ]; - noCheck = true; - }; - - "/home/mherold/camera/2022-05-15" = - { device = "/dev/zvol/hdd-raid6/safe/home/mherold/camera/2022-05-15"; - fsType = "vfat"; - options = [ "uid=mherold" "gid=users" "x-systemd.automount" "x-systemd.idle-timeout=120" ]; - noCheck = true; - }; - - "/home/mherold/camera/2022-12-29" = - { device = "/dev/zvol/hdd-raid6/safe/home/mherold/camera/2022-12-29"; - fsType = "vfat"; - options = [ "uid=mherold" "gid=users" "x-systemd.automount" "x-systemd.idle-timeout=120" ]; - noCheck = true; - }; }; + systemd.mounts = map (date: { + where = "/home/mherold/camera/${date}"; + what = "/dev/zvol/hdd-raid6/safe/home/mherold/camera/${date}"; + type = "vfat"; + options = lib.concatStringsSep "," + [ "ro" + "uid=mherold" "gid=users" "fmask=0177" "dmask=0077" + "nofail" + ]; + }) ["2020-09-13" "2022-01-16" "2022-05-15" "2022-12-29"]; + systemd.automounts = map (date: { + wantedBy = [ "multi-user.target" ]; + + where = "/home/mherold/camera/${date}"; + + automountConfig.TimeoutIdleSec = "2m"; + }) ["2020-09-13" "2022-01-16" "2022-05-15" "2022-12-29"]; + users.users.gkleen.createHome = lib.mkForce false; users.users.mherold.createHome = lib.mkForce false; -- cgit v1.2.3