summaryrefslogtreecommitdiffstats
path: root/4lib
diff options
context:
space:
mode:
Diffstat (limited to '4lib')
-rw-r--r--4lib/tv/default.nix23
1 files changed, 21 insertions, 2 deletions
diff --git a/4lib/tv/default.nix b/4lib/tv/default.nix
index ec46d8ea8..5eb9ac45f 100644
--- a/4lib/tv/default.nix
+++ b/4lib/tv/default.nix
@@ -76,6 +76,10 @@ builtins // lib // rec {
net = submodule ({ config, ... }: {
options = {
+ via = mkOption {
+ type = nullOr net;
+ default = null;
+ };
addrs = mkOption {
type = listOf addr;
apply = _: config.addrs4 ++ config.addrs6;
@@ -92,8 +96,23 @@ builtins // lib // rec {
# TODO nonEmptyListOf hostname
type = listOf hostname;
};
- tinc-key = mkOption {
- type = str;
+ tinc = mkOption {
+ type = submodule {
+ options = {
+ config = mkOption {
+ type = str;
+ apply = _: ''
+ ${optionalString (config.via != null)
+ (concatMapStringsSep "\n" (a: "Address = ${a}") config.via.addrs)}
+ ${concatMapStringsSep "\n" (a: "Subnet = ${a}") config.addrs}
+ ${config.tinc.pubkey}
+ '';
+ };
+ pubkey = mkOption {
+ type = str;
+ };
+ };
+ };
};
};
});