summary refs log tree commit diff stats
path: root/system/settings/services/samba.nix
blob: 63283e88f494b4e0e6b702cc14cbe9fe7abb6dda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
    '';
  };
}