2024-04-07 16:34:42 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
services.samba = {
|
|
|
|
enable = true;
|
|
|
|
securityType = "user";
|
|
|
|
openFirewall = true;
|
|
|
|
extraConfig = ''
|
2024-04-10 17:00:40 +02:00
|
|
|
workgroup = WORKGROUP
|
2024-04-10 16:46:02 +02:00
|
|
|
server string = galadriel
|
|
|
|
netbios name = galadriel
|
2024-04-07 16:34:42 +02:00
|
|
|
security = user
|
|
|
|
#use sendfile = yes
|
|
|
|
#max protocol = smb2
|
2024-04-10 17:00:40 +02:00
|
|
|
min protocol = SMB2
|
2024-04-07 16:34:42 +02:00
|
|
|
# note: localhost is the ipv6 localhost ::1
|
2024-04-10 16:46:02 +02:00
|
|
|
hosts allow = 192.168.1. 127.0.0.1 localhost 100.
|
|
|
|
hosts deny = 0.0.0.0/0
|
2024-04-07 16:34:42 +02:00
|
|
|
guest account = nobody
|
|
|
|
map to guest = bad user
|
2024-04-10 17:00:40 +02:00
|
|
|
smb encrypt = required
|
2024-04-07 16:34:42 +02:00
|
|
|
'';
|
|
|
|
shares = {
|
|
|
|
# public = {
|
|
|
|
# path = "/mnt/Shares/Public";
|
|
|
|
# browseable = "yes";
|
|
|
|
# "read only" = "no";
|
|
|
|
# "guest ok" = "yes";
|
|
|
|
# "create mask" = "0644";
|
|
|
|
# "directory mask" = "0755";
|
|
|
|
# "force user" = "username";
|
|
|
|
# "force group" = "groupname";
|
|
|
|
# };
|
2024-04-10 16:46:02 +02:00
|
|
|
Backup = {
|
|
|
|
path = "/Main/Backup";
|
2024-04-07 16:34:42 +02:00
|
|
|
"valid users" = "gunalx";
|
|
|
|
"force user" = "gunalx";
|
|
|
|
"force group" = "gunalx";
|
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "no";
|
|
|
|
"create mask" = "0644";
|
|
|
|
"directory mask" = "0755";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.samba-wsdd = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
#networking.firewall.enable = true;
|
|
|
|
networking.firewall.allowPing = true;
|
|
|
|
|
|
|
|
|
|
|
|
}
|