summary refs log tree commit diff stats
path: root/system/settings/services/samba.nix
blob: ae6c6f5a9ce868bf28de3db36df0cbe62c623bc2 (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
31
{ 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
    '';
  };
}