Add initial native smb share

doesn't really work yet from windows side, but linux works
This commit is contained in:
GHOSCHT 2024-06-13 23:29:40 +02:00
parent b0e2738905
commit 2bf237f1da
Signed by: ghoscht
GPG key ID: 2C2C1C62A5388E82
2 changed files with 58 additions and 0 deletions

View file

@ -26,6 +26,7 @@ in {
./restic.nix ./restic.nix
./arion ./arion
./hydra.nix ./hydra.nix
./samba.nix
]; ];
# Enable ZFS # Enable ZFS

57
hosts/franz/samba.nix Normal file
View file

@ -0,0 +1,57 @@
{
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
extraConfig = ''
workgroup = WORKGROUP
server string = franz
netbios name = franz
security = user
#use sendfile = yes
#max protocol = smb2
# note: localhost is the ipv6 localhost ::1
hosts allow = 192.168.178. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
# debugging
# log file = /var/log/samba/log.%m
# max log size = 1000
# logging = file
'';
# Run sudo smbpasswd -a <username> to set the smb password for an EXISTING linux user
shares = {
software = {
path = "/storage/dataset/data/torrents/misc";
browseable = "yes";
"read only" = "yes";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "ghoscht";
"force group" = "users";
};
max = {
path = "/storage/dataset/nas/max";
browseable = "yes";
"read only" = "no";
"guest ok" = "no";
"valid users" = "max";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "ghoscht";
"force group" = "users";
};
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
networking.firewall.allowPing = true;
}