diff options
Diffstat (limited to 'custom')
-rw-r--r-- | custom/tinc/def.nix | 145 |
1 files changed, 72 insertions, 73 deletions
diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index a3bb00a0..98174eb6 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix | |||
@@ -6,6 +6,77 @@ let | |||
6 | 6 | ||
7 | cfg = config.services.customTinc; | 7 | cfg = config.services.customTinc; |
8 | 8 | ||
9 | networkModule = { | ||
10 | extraConfig = mkOption { | ||
11 | default = '' | ||
12 | PingTimeout = 10 | ||
13 | ''; | ||
14 | type = types.lines; | ||
15 | description = '' | ||
16 | Extra lines to add to the tinc service configuration file. | ||
17 | ''; | ||
18 | }; | ||
19 | |||
20 | name = mkOption { | ||
21 | default = null; | ||
22 | type = types.nullOr types.str; | ||
23 | description = '' | ||
24 | The name of the node which is used as an identifier when communicating | ||
25 | with the remote nodes in the mesh. If null then the hostname of the system | ||
26 | is used. | ||
27 | ''; | ||
28 | }; | ||
29 | |||
30 | debugLevel = mkOption { | ||
31 | default = 0; | ||
32 | type = types.addCheck types.int (l: l >= 0 && l <= 5); | ||
33 | description = '' | ||
34 | The amount of debugging information to add to the log. 0 means little | ||
35 | logging while 5 is the most logging. <command>man tincd</command> for | ||
36 | more details. | ||
37 | ''; | ||
38 | }; | ||
39 | |||
40 | hosts = mkOption { | ||
41 | default = { }; | ||
42 | type = types.loaOf types.lines; | ||
43 | description = '' | ||
44 | The name of the host in the network as well as the configuration for that host. | ||
45 | This name should only contain alphanumerics and underscores. | ||
46 | ''; | ||
47 | }; | ||
48 | |||
49 | interfaceType = mkOption { | ||
50 | default = "tun"; | ||
51 | type = types.addCheck types.str (n: n == "tun" || n == "tap"); | ||
52 | description = '' | ||
53 | The type of virtual interface used for the network connection | ||
54 | ''; | ||
55 | }; | ||
56 | |||
57 | interfaceConfig = mkOption { | ||
58 | default = { }; | ||
59 | description = '' | ||
60 | Additional configuration for the generated network interface | ||
61 | ''; | ||
62 | }; | ||
63 | |||
64 | package = mkOption { | ||
65 | default = pkgs.tinc_pre; | ||
66 | description = '' | ||
67 | The package to use for the tinc daemon's binary. | ||
68 | ''; | ||
69 | }; | ||
70 | |||
71 | scripts = mkOption { | ||
72 | default = { }; | ||
73 | type = types.loaOf (types.nullOr types.str); | ||
74 | description = '' | ||
75 | Hook scripts | ||
76 | ''; | ||
77 | }; | ||
78 | |||
79 | }; | ||
9 | in | 80 | in |
10 | 81 | ||
11 | { | 82 | { |
@@ -18,83 +89,11 @@ in | |||
18 | 89 | ||
19 | networks = mkOption { | 90 | networks = mkOption { |
20 | default = { }; | 91 | default = { }; |
21 | type = types.loaOf types.submodule; | 92 | type = types.loaOf (types.submodule networkModule); |
22 | description = '' | 93 | description = '' |
23 | Defines the tinc networks which will be started. | 94 | Defines the tinc networks which will be started. |
24 | Each network invokes a different daemon. | 95 | Each network invokes a different daemon. |
25 | ''; | 96 | ''; |
26 | options = { | ||
27 | |||
28 | extraConfig = mkOption { | ||
29 | default = '' | ||
30 | PingTimeout = 10 | ||
31 | ''; | ||
32 | type = types.lines; | ||
33 | description = '' | ||
34 | Extra lines to add to the tinc service configuration file. | ||
35 | ''; | ||
36 | }; | ||
37 | |||
38 | name = mkOption { | ||
39 | default = null; | ||
40 | type = types.nullOr types.str; | ||
41 | description = '' | ||
42 | The name of the node which is used as an identifier when communicating | ||
43 | with the remote nodes in the mesh. If null then the hostname of the system | ||
44 | is used. | ||
45 | ''; | ||
46 | }; | ||
47 | |||
48 | debugLevel = mkOption { | ||
49 | default = 0; | ||
50 | type = types.addCheck types.int (l: l >= 0 && l <= 5); | ||
51 | description = '' | ||
52 | The amount of debugging information to add to the log. 0 means little | ||
53 | logging while 5 is the most logging. <command>man tincd</command> for | ||
54 | more details. | ||
55 | ''; | ||
56 | }; | ||
57 | |||
58 | hosts = mkOption { | ||
59 | default = { }; | ||
60 | type = types.loaOf types.lines; | ||
61 | description = '' | ||
62 | The name of the host in the network as well as the configuration for that host. | ||
63 | This name should only contain alphanumerics and underscores. | ||
64 | ''; | ||
65 | }; | ||
66 | |||
67 | interfaceType = mkOption { | ||
68 | default = "tun"; | ||
69 | type = types.addCheck types.str (n: n == "tun" || n == "tap"); | ||
70 | description = '' | ||
71 | The type of virtual interface used for the network connection | ||
72 | ''; | ||
73 | }; | ||
74 | |||
75 | interfaceConfig = mkOption { | ||
76 | default = { }; | ||
77 | description = '' | ||
78 | Additional configuration for the generated network interface | ||
79 | ''; | ||
80 | }; | ||
81 | |||
82 | package = mkOption { | ||
83 | default = pkgs.tinc_pre; | ||
84 | description = '' | ||
85 | The package to use for the tinc daemon's binary. | ||
86 | ''; | ||
87 | }; | ||
88 | |||
89 | scripts = mkOption { | ||
90 | default = { }; | ||
91 | type = types.loaOf (types.nullOr types.str); | ||
92 | description = '' | ||
93 | Hook scripts | ||
94 | ''; | ||
95 | }; | ||
96 | |||
97 | }; | ||
98 | }; | 97 | }; |
99 | }; | 98 | }; |
100 | 99 | ||