-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsamba.nix
63 lines (60 loc) · 1.89 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
56
57
58
59
60
61
62
63
# -*- coding: utf-8 -*-
# :Project: giskard -- Samba service config
# :Created: dom 16 set 2018 21:57:41 CEST
# :Author: Alberto Berti <[email protected]>
# :License: GNU General Public License version 3 or later
# :Copyright: © 2018 Alberto Berti
#
{ config, pkgs, ... }: {
services.samba = {
enable = true;
extraConfig = ''
auto services = azazel emilia
[homes]
read only = no
browsable = no
# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
create mask = 0700
# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
directory mask = 0700
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
valid users = %S
map archive = no
'';
shares = {
musica = {
path = "/mnt/musica";
browsable = true;
"read only" = false;
"guest ok" = true;
"write users" = [ "@musica" ];
"force group" = "musica";
"map archive" = false;
};
books = {
path = "/mnt/books";
browsable = true;
"read only" = false;
"guest ok" = true;
"write users" = [ "@books" ];
"force group" = "books";
"map archive" = false;
};
torrents = {
path = "/mnt/data/transmission/scaricati";
browsable = true;
"read only" = false;
"guest ok" = true;
"write users" = [ "@users" ];
"force group" = "users";
"map archive" = false;
};
};
};
}