From 444fefdd8e9ff1e8ff2441d549a01e38b8ff0808 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Tue, 16 Jul 2024 17:07:43 -0400 Subject: [PATCH] hosts/common/samba: reuse options --- hosts/common/samba.nix | 57 ++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/hosts/common/samba.nix b/hosts/common/samba.nix index 44eb977c..283907e2 100644 --- a/hosts/common/samba.nix +++ b/hosts/common/samba.nix @@ -3,41 +3,32 @@ lib, ... }: { - fileSystems = lib.attrsets.optionalAttrs (config.networking.hostName != "mauville") { - "/mnt/Archive" = { - device = "//mauville/Archive"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; - }; + fileSystems = let + fsType = "cifs"; + options = [ + "gid=100" + "guest" + "nofail" + "uid=${toString config.users.users.aly.uid}" + "x-systemd.after=network.target" + "x-systemd.after=tailscaled.service" + "x-systemd.automount" + "x-systemd.device-timeout=5s" + "x-systemd.idle-timeout=60" + "x-systemd.mount-timeout=5s" + ]; + in + lib.attrsets.optionalAttrs (config.networking.hostName != "mauville") { + "/mnt/Archive" = { + inherit options fsType; + device = "//mauville/Archive"; + }; - "/mnt/Media" = { - device = "//mauville/Media"; - fsType = "cifs"; - options = [ - "gid=100" - "guest" - "nofail" - "uid=${toString config.users.users.aly.uid}" - "x-systemd.after=network.target" - "x-systemd.after=tailscaled.service" - "x-systemd.automount" - "x-systemd.device-timeout=5s" - "x-systemd.idle-timeout=60" - "x-systemd.mount-timeout=5s" - ]; + "/mnt/Media" = { + inherit options fsType; + device = "//mauville/Media"; + }; }; - }; home-manager.sharedModules = [ {