-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopology.nix
64 lines (60 loc) · 1.38 KB
/
topology.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
{
config,
pkgs,
...
}: let
inherit (config.lib.topology) mkInternet mkRouter mkConnection mkConnectionRev mkSwitch;
in {
#inherit (self) nixosConfigurations;
# Add a node for the internet
nodes.internet = mkInternet {
connections = mkConnection "f6600p" "wan1";
};
nodes.f6600p = mkRouter "f6600p" {
info = "ZTE F6600P";
interfaceGroups = [
(
map
(n: "lan${toString n}")
(pkgs.lib.range 0 3)
)
["wan1"]
];
};
nodes.tplink-lr = mkSwitch "TP-Link-lr" {
info = "TP-Link Living Room";
interfaceGroups = [
(
map
(n: "lan${toString n}")
(pkgs.lib.range 0 3)
)
["wlan"]
];
interfaces.lan1.network = "home";
interfaces.wlan.network = "home";
connections.wlan = [(mkConnection "tplink-office" "wlan") (mkConnection "zuse-klappi" "eno1")];
connections.lan1 = [(mkConnection "f6600p" "lan1")];
};
nodes.tplink-office = mkSwitch "TP-Link-lr" {
info = "TP-Link Living Room";
interfaceGroups = [
(
map
(n: "lan${toString n}")
(pkgs.lib.range 0 3)
)
["wlan"]
];
interfaces.lan1.network = "home";
interfaces.wlan.network = "home";
connections.lan1 = [
(mkConnection "zuse" "eno1")
(mkConnection "nas" "eno1")
];
};
networks.home = {
name = "Home";
cidrv4 = "192.168.1.0/24";
};
}