58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{ config, ... }:
|
|
|
|
{
|
|
services.samba-wsdd = {
|
|
# make shares visible for Windows clients
|
|
enable = true;
|
|
openFirewall = true;
|
|
};
|
|
|
|
services.samba = {
|
|
enable = true;
|
|
enableNmbd = true;
|
|
securityType = "user";
|
|
|
|
extraConfig = ''
|
|
workgroup = WORKGROUP
|
|
server string = BFDS
|
|
# netbios name = BFDS
|
|
server role = standalone server
|
|
|
|
log file = /var/log/samba/smbd.%m
|
|
max log size = 50
|
|
|
|
#dns proxy = no
|
|
#security = user
|
|
#use sendfile = yes
|
|
#max protocol = smb2
|
|
# note: localhost is the ipv6 localhost ::1
|
|
#hosts allow = 192.168.0. 127.0.0.1 localhost
|
|
#hosts deny = 0.0.0.0/0
|
|
#guest account = nobody
|
|
map to guest = bad user
|
|
'';
|
|
|
|
shares = {
|
|
public = {
|
|
path = "/bfds-nix/"; ## "/mnt/Shares/Public";
|
|
browseable = "yes";
|
|
"writable" = "yes";
|
|
#"guest ok" = "yes";
|
|
"public" = "yes";
|
|
"force user" = "share";
|
|
|
|
#"create mask" = "0644";
|
|
#"directory mask" = "0755";
|
|
#"force user" = "smbuser";
|
|
#"force group" = "smbuser";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Curiously, `services.samba` does not automatically open
|
|
# the needed ports in the firewall.
|
|
networking.firewall.allowedTCPPorts = [ 445 139 ];
|
|
networking.firewall.allowedUDPPorts = [ 137 138 ];
|
|
|
|
}
|