summaryrefslogtreecommitdiff
path: root/hosts/vidhar/samba.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/samba.nix')
-rw-r--r--hosts/vidhar/samba.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/hosts/vidhar/samba.nix b/hosts/vidhar/samba.nix
new file mode 100644
index 00000000..b3722617
--- /dev/null
+++ b/hosts/vidhar/samba.nix
@@ -0,0 +1,81 @@
1{ config, lib, pkgs, ... }:
2{
3 config = {
4 services.samba = {
5 enable = true;
6 securityType = "user";
7 extraConfig = ''
8 domain master = yes
9 workgroup = WORKGROUP
10 load printers = no
11 printing = bsd
12 printcap name = /dev/null
13 disable spoolss = yes
14 guest account = nobody
15 bind interfaces only = yes
16 interfaces = lo lan
17 '';
18 shares = {
19 homes = {
20 comment = "Home Directories";
21 path = "/home/%S";
22 browseable = "no";
23 "valid users" = "%S";
24 "read only" = "no";
25 "create mask" = "0700";
26 "directory mask" = "0700";
27 "vfs objects" = "shadow_copy2";
28 "shadow:snapdir" = ".zfs/snapshot";
29 "shadow:sort" = "desc";
30 "shadow:format" = "%Y-%m-%d-%Hh%MU";
31 "shadow:snapprefix" = "^zfs-auto-snap_\(frequent\)\{0,1\}\(hourly\)\{0,1\}\(daily\)\{0,1\}\(monthly\)\{0,1\}";
32 "shadow:delimiter" = "-";
33 };
34 eos = {
35 comment = "Disk image of eos";
36 browseable = true;
37 "valid users" = "mherold";
38 writeable = "true";
39 path = "/srv/eos";
40 };
41 };
42 };
43 services.samba-wsdd = {
44 enable = true;
45 workgroup = "WORKGROUP";
46 interface = [ "lo" "lan" ];
47 };
48
49 fileSystems."/srv/eos.lower" = {
50 device = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/base";
51 fsType = "ntfs3";
52 options = [ "ro" "uid=mherold" "gid=users" "fmask=0177" "dmask=0077" "nofail" "noauto" ];
53 };
54
55 fileSystems."/srv/eos.upper" = {
56 device = "/dev/zvol/hdd-raid6/safe/home/mherold/eos/upper";
57 fsType = "ext4";
58 options = [ "nofail" "noauto" ];
59 };
60
61 systemd.mounts = [
62 {
63 wantedBy = [ "samba-smbd.service" ];
64 before = [ "samba-smbd.service" ];
65
66 where = "/srv/eos";
67 what = "overlay";
68 type = "overlay";
69 options = lib.concatStringsSep ","
70 [ "lowerdir=/srv/eos.lower"
71 "upperdir=/srv/eos.upper/upper"
72 "workdir=/srv/eos.upper/work"
73 ];
74
75 unitConfig = {
76 RequiresMountsFor = [ "/srv/eos.lower" "/srv/eos.upper" ];
77 };
78 }
79 ];
80 };
81}