types tinc: add weight option

This commit is contained in:
lassulus 2021-11-23 15:28:06 +01:00
parent ff9a042e70
commit 4c7abec397

View File

@ -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;