-
Notifications
You must be signed in to change notification settings - Fork 1
/
containers.nix
86 lines (78 loc) · 2.37 KB
/
containers.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ config, lib , ...}:
{
config = lib.mkMerge [{
networking.nat.enable = true;
networking.nat.internalInterfaces = ["ve-+" "tap-boogihn"];
networking.nat.externalInterface = "wlp9s0"; # TOOO: parameterize for primary interface.
virtualisation.docker.enable = false;
virtualisation.docker.storageDriver = "btrfs";
networking.firewall.extraCommands = ''
iptables -A INPUT -p tcp --dport 25 -s 10.233.1.2 -j ACCEPT
iptables -A INPUT -p tcp -s 192.168.199.2/28 -j ACCEPT
iptables -A INPUT -p udp -s 192.168.199.2/28 -j ACCEPT
'';
}
(lib.mkIf config.host.virtualbox.enable {
virtualisation.virtualbox.host.enable = true;
})
(lib.mkIf (config.host.samba.enable) {
services.samba.enable = true;
services.samba.extraConfig = ''
guest ok = no
guest only = no
valid users = edanaher kduncan
force user = edanaher
security = user
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
acl allow execute always = true
ntlm auth = true
smb2 max credits 32768
'';
services.samba.shares = {
transfer = {
path = "/build/windows/transfer/";
browseable = "yes";
comment = "Share for boogihn";
"read only" = "no";
"valid users" = "edanaher";
"force user" = "edanaher";
};
camera-all = {
path = "/mnt/bak/deretheni/camera-all/";
browseable = "yes";
comment = "Backup of all deretheni pictures";
"read only" = "yes";
"valid users" = "edanaher";
"force user" = "edanaher";
};
kduncan-bak = {
path = "/mnt/kelly-bak/";
browseable = "yes";
comment = "Kelly's backup";
"read only" = "no";
"valid users" = "kduncan";
"force user" = "kduncan";
"fruit:appl" = "yes";
# "vfs objects" = "catia fruit streams_xattr";
};
};
})
];
options.host.virtualbox = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable virtualbox";
};
};
options.host.samba = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable samba";
};
};
}