summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-12-09 16:50:58 +0100
committerlassulus <lassulus@lassul.us>2018-12-09 16:50:58 +0100
commit149b7f49ec23eaeb9236d1b9b85d7a6bd1b611ad (patch)
tree122d3e8116ce42eeebbe605fb08a7892dd36fd1d /lib
parent24c9ea126b620f341ec95b9c779fddb55c144ab2 (diff)
lib types nets: add wireguard
Diffstat (limited to 'lib')
-rw-r--r--lib/types.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 41e75154..17c1688f 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -192,6 +192,28 @@ rec {
}));
default = null;
};
+ wireguard = mkOption {
+ type = nullOr (submodule ({ config, ... }: {
+ options = {
+ port = mkOption {
+ type = int;
+ description = "tinc port to use to connect to host";
+ default = 51820;
+ };
+ pubkey = mkOption {
+ type = wireguard-pubkey;
+ };
+ subnets = mkOption {
+ type = listOf cidr;
+ description = ''
+ wireguard subnets,
+ this defines how routing behaves for hosts that can't reach each other.
+ '';
+ default = [];
+ };
+ };
+ }));
+ };
};
});
@@ -548,4 +570,6 @@ rec {
check = filename.check;
merge = mergeOneOption;
};
+
+ wireguard-pubkey = str;
}