2024-08-08 09:02:42 +08:00
|
|
|
{...}: {
|
2024-06-03 21:10:23 +08:00
|
|
|
services.samba = {
|
|
|
|
enable = true;
|
|
|
|
securityType = "user";
|
|
|
|
openFirewall = true;
|
|
|
|
extraConfig = ''
|
|
|
|
workgroup = WORKGROUP
|
|
|
|
server string = smbnix
|
|
|
|
netbios name = smbnix
|
2024-08-08 09:02:42 +08:00
|
|
|
security = user
|
2024-06-03 21:10:23 +08:00
|
|
|
#use sendfile = yes
|
|
|
|
#max protocol = smb2
|
|
|
|
# note: localhost is the ipv6 localhost ::1
|
2024-09-07 18:44:01 +08:00
|
|
|
hosts allow = 192.168.50.237 192.168.50.12 127.0.0.1 localhost
|
2024-06-03 21:10:23 +08:00
|
|
|
hosts deny = 0.0.0.0/0
|
|
|
|
guest account = nobody
|
|
|
|
map to guest = bad user
|
|
|
|
'';
|
|
|
|
shares = {
|
|
|
|
spectre = {
|
|
|
|
path = "/srv/shares/spectre";
|
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "no";
|
|
|
|
"create mask" = "0644";
|
|
|
|
"directory mask" = "0755";
|
|
|
|
"force user" = "spectre";
|
|
|
|
"force group" = "users";
|
|
|
|
};
|
|
|
|
sajenim = {
|
|
|
|
path = "/srv/shares/sajenim";
|
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "no";
|
|
|
|
"create mask" = "0644";
|
|
|
|
"directory mask" = "0755";
|
|
|
|
"force user" = "sajenim";
|
|
|
|
"force group" = "users";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.samba-wsdd = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
2024-08-08 09:02:42 +08:00
|
|
|
environment.persistence."/persist".directories = ["/var/lib/samba"];
|
2024-06-03 21:10:23 +08:00
|
|
|
}
|