setup SMB in config file (provide smpasswd in terminal is needed too)

This commit is contained in:
Rob committed 2024-01-16 21:11:22 +00:00
1 parent e65d1b28ac
commit b67d5b20ae
4 files changed
+41 -44

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
{ config, ... }:
{
services.samba-wsdd = {
# make shares visible for Windows clients
enable = true;
openFirewall = true;
};
services.samba = {
enable = true;
securityType = "user";
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
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";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "username";
"force group" = "groupname";
};
};
};
}