Files
nix-config/nas-samba/samba.nix
2024-02-19 22:38:55 -06:00

72 lines
1.8 KiB
Nix

{ config, ... }:
{
# make shares visible for Windows clients
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
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 = 10.0.1. 127.0.0.1 localhost
hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
"3d_printer" = {
path = "/mnt/Main\ Pool/3d_printer";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
};
Backup = {
path = "/mnt/Main\ Pool/Backup";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
};
Documents = {
path = "/mnt/Main\ Pool/Documents";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
};
isos = {
path = "/mnt/Main\ Pool/isos";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
};
TimeMachine = {
path = "/mnt/Main\ Pool/TimeMachine";
"valid users" = "mattjallen";
public = "no";
writable = "yes";
"force user" = "mattjallen";
"fruit:aapl" = "yes";
"fruit:time machine" = "yes";
"vfs objects" = "catia fruit streams_xattr";
};
};
};
}