From 53ce3910aa762fc24aaab9d675482081cdea2811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 12 Sep 2023 23:10:59 +0300 Subject: [PATCH] replace nmbd with wsdd https://askubuntu.com/questions/661611/make-samba-share-visible-in-windows-network --- data.nix | 9 +++++---- modules/services/jakstpub/default.nix | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/data.nix b/data.nix index d19bf16..2ed748a 100644 --- a/data.nix +++ b/data.nix @@ -96,13 +96,14 @@ rec { sshPattern = "100.89.176.?"; # until we have more hosts }; motiejus.cidrs = let - mHosts = + mHosts = attrVals [ - "mxp10.motiejus.jakst" - "fwmine.motiejus.jakst" + "mxp10.motiejus.jakst" + "fwmine.motiejus.jakst" ] hosts; - in builtins.catAttrs "jakstIP" mHosts; + in + builtins.catAttrs "jakstIP" mHosts; vno1.cidr = "192.168.189.0/24"; }; diff --git a/modules/services/jakstpub/default.nix b/modules/services/jakstpub/default.nix index f0dc55d..70c9b24 100644 --- a/modules/services/jakstpub/default.nix +++ b/modules/services/jakstpub/default.nix @@ -19,8 +19,8 @@ # https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Standalone_Server enable = true; securityType = "user"; - enableNmbd = true; - enableWinbindd = true; + enableNmbd = false; + enableWinbindd = false; extraConfig = '' map to guest = Bad User log level = 1 @@ -42,6 +42,8 @@ }; }; + services.samba-wsdd.enable = true; + users.users.jakstpub = { description = "Jakstys Public"; home = "/var/empty"; @@ -58,10 +60,16 @@ unitConfig.Requires = requires; }; - mj.services.friendlyport.ports = [{ - subnets = with myData.subnets; [tailscale.cidr vno1.cidr]; - tcp = [ 139 445 ]; - udp = [ 137 138 ]; - }]; + mj.services.friendlyport.ports = [ + { + subnets = with myData.subnets; [tailscale.cidr vno1.cidr]; + tcp = [ + 139 # smbd + 445 # smbd + 5357 # wsdd + ]; + udp = [3702]; # wsdd + } + ]; }; }