summary refs log tree commit diff stats
path: root/system/settings
diff options
context:
space:
mode:
Diffstat (limited to 'system/settings')
-rw-r--r--system/settings/services/samba.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/system/settings/services/samba.nix b/system/settings/services/samba.nix
new file mode 100644
index 00000000..63283e88
--- /dev/null
+++ b/system/settings/services/samba.nix
@@ -0,0 +1,30 @@
+{ config, pkgs, ... }:
+
+let
+  workgroup = "WORKGROUP";
+
+in
+{
+  services.samba-wsdd = {
+    inherit workgroup;
+    enable = true;
+  };
+  networking.firewall.allowedTCPPorts = [ 5357 ];
+  networking.firewall.allowedUDPPorts = [ 3702 ];
+
+  services.samba = {
+    enable = true;
+    openFirewall = true;
+    securityType = "user";
+    extraConfig = ''
+      workgroup = ${workgroup}
+      server string = ${config.networking.hostName}
+      netbios name = ${config.networking.hostName}
+      security = user
+      #use sendfile = yes
+      #max protocol = smb2
+      guest account = nobody
+      map to guest = bad user
+    '';
+  };
+}