84 lines
2.0 KiB
Nix
84 lines
2.0 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/mainpool/3d_printer";
|
|
browseable = "yes";
|
|
"read only" = "no";
|
|
"guest ok" = "yes";
|
|
"create mask" = "0644";
|
|
"directory mask" = "0755";
|
|
};
|
|
Backup = {
|
|
path = "/mnt/mainpool/Backup";
|
|
browseable = "yes";
|
|
"read only" = "no";
|
|
"guest ok" = "yes";
|
|
"create mask" = "0644";
|
|
"directory mask" = "0755";
|
|
};
|
|
Documents = {
|
|
path = "/mnt/mainpool/Documents";
|
|
browseable = "yes";
|
|
"read only" = "no";
|
|
"guest ok" = "yes";
|
|
"create mask" = "0644";
|
|
"directory mask" = "0755";
|
|
};
|
|
isos = {
|
|
path = "/mnt/mainpool/isos";
|
|
browseable = "yes";
|
|
"read only" = "no";
|
|
"guest ok" = "yes";
|
|
"create mask" = "0644";
|
|
"directory mask" = "0755";
|
|
};
|
|
TimeMachine = {
|
|
path = "/mnt/mainpool/TimeMachine";
|
|
public = "no";
|
|
private = "yes";
|
|
browseable = "yes";
|
|
writable = "yes";
|
|
"fruit:aapl" = "yes";
|
|
"fruit:time machine" = "yes";
|
|
"vfs objects" = "catia fruit streams_xattr";
|
|
"fruit:time machine max size" = "1T";
|
|
};
|
|
};
|
|
};
|
|
|
|
services.netatalk = {
|
|
enable = true;
|
|
settings = {
|
|
time-machine = {
|
|
path = "/mnt/mainpool/TimeMachine";
|
|
"valid users" = "whoever";
|
|
"time machine" = true;
|
|
};
|
|
};
|
|
};
|
|
}
|