From 397fcd4a44dd54bd923684f92fb24abeb2739b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Fri, 22 Sep 2023 10:14:10 +0300 Subject: [PATCH] jakstpub: nicer smb settings --- modules/services/jakstpub/default.nix | 38 +++++++++++++++------------ 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/modules/services/jakstpub/default.nix b/modules/services/jakstpub/default.nix index ab7194f..32ae2e8 100644 --- a/modules/services/jakstpub/default.nix +++ b/modules/services/jakstpub/default.nix @@ -41,27 +41,31 @@ in { guest account = jakstpub server role = standalone server ''; - shares = { - public = { - path = cfg.dataDir; - writeable = "yes"; - public = "yes"; + shares = let + defaults = { + "public" = "yes"; + "mangled names" = "no"; "guest ok" = "yes"; - "read only" = "no"; - "create mask" = "0664"; - "directory mask" = "0775"; - "force user" = "jakstpub"; - "force group" = "jakstpub"; - }; - snapshots = { - path = cfg.dataDir + "/.zfs/snapshot"; - writeable = "no"; - public = "yes"; - "guest ok" = "yes"; - "read only" = "yes"; "force user" = "jakstpub"; "force group" = "jakstpub"; }; + in { + public = + defaults + // { + "path" = cfg.dataDir; + "writeable" = "yes"; + "read only" = "no"; + "create mask" = "0664"; + "directory mask" = "0775"; + }; + snapshots = + defaults + // { + "path" = cfg.dataDir + "/.zfs/snapshot"; + "writeable" = "no"; + "read only" = "yes"; + }; }; };