summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-11-23 15:28:06 +0100
committerlassulus <lassulus@lassul.us>2021-11-23 15:50:05 +0100
commit4c7abec39771cbd47dc091c674a0429f5c757ebc (patch)
tree804a7330836a6764ff297782f24dece39471d542 /lib
parentff9a042e70779e860d7a07a24e3ffb1f40119c32 (diff)
types tinc: add weight option
Diffstat (limited to 'lib')
-rw-r--r--lib/types.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index c50969de7..6755eef03 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -187,6 +187,8 @@ rec {
[config.extraConfig]
++
[config.pubkey]
+ ++
+ optional (config.weight != null) "Weight = ${toString config.weight}"
);
defaultText = ''
Address = ‹addr› ‹port› # for each ‹net.via.addrs›
@@ -217,6 +219,15 @@ rec {
description = "tinc subnets";
default = [];
};
+ weight = mkOption {
+ type = nullOr int;
+ description = ''
+ global tinc weight (latency in ms) of this particular node.
+ can be set to some high value to make it unprobable to be used as router.
+ if set to null, tinc will autogenerate the value based on latency.
+ '';
+ default = if net.via != null then null else 300;
+ };
};
}));
default = null;