/
samba.nix
55 lines (53 loc) · 1.36 KB
/
samba.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ pkgs, ... }:
let
my = import ./myself.nix;
in
{
# https://nixos.wiki/wiki/Samba
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
services.samba = {
enable = true;
securityType = "user";
extraConfig = ''
workgroup = WORKGROUP
server string = smbnix
netbios name = smbnix
security = user
# use sendfile = yes
# max protocol = smb2
# note: localhost is the ipv6 localhost ::1
interfaces = 192.168.122.0/24 virbr0 192.168.10.0/24 wlp0s20f3
# hosts allow = 192.168.10 192.168.122 127.0.0.1 localhost
# hosts deny = 0.0.0.0/0
guest account = nobody
map to guest = bad user
'';
shares = {
homes = {
browseable = "no";
"read only" = "yes";
"guest ok" = "no";
};
Music = {
path = "/srv/Music/";
browseable = "no";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "${my.username}";
"force group" = "users";
};
Photos = {
path = "/srv/Photos/";
browseable = "no";
"read only" = "no";
"guest ok" = "no";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = "${my.username}";
"force group" = "users";
};
};
};
}