diff options
| author | Max Audron <audron@cocaine.farm> | 2023-08-11 16:51:35 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2023-08-11 16:51:35 +0200 |
| commit | 5828af9fc19e18dc85e49fcc1a251a7eb25d909c (patch) | |
| tree | c70c3e52237c08d3fdcb2f1269c524c25e3feeb8 /modules/wireguard/options.nix | |
init
Diffstat (limited to 'modules/wireguard/options.nix')
| -rw-r--r-- | modules/wireguard/options.nix | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/modules/wireguard/options.nix b/modules/wireguard/options.nix new file mode 100644 index 0000000..903716e --- /dev/null +++ b/modules/wireguard/options.nix @@ -0,0 +1,71 @@ +{ config, lib, pkgs, nodes, builtins, ... }: + +with lib; { + options = { + wireguard = { + enable = mkOption { + type = types.bool; + description = "Enable wireguard"; + }; + roaming = mkOption { + type = types.bool; + description = "Deploy roaming peers to this host"; + default = false; + }; + port = mkOption { + type = types.int; + description = "Port of the wireguard interface (51820)"; + default = 51820; + }; + publicKey = mkOption { + type = types.str; + description = "Public key of the wireguard interface"; + }; + natInterface = mkOption { + type = types.str; + description = "Interface to use for outgoing NAT connections"; + default = "eth0"; + }; + v4 = { + address = mkOption { + type = types.str; + description = "IP of the wireguard interface (10.10.0.1)"; + }; + network = mkOption { + type = types.str; + description = "The Network CIDR of the wireguard network (10.10.0.0)"; + }; + prefixLength = mkOption { + type = types.int; + description = "Prefix Length of the wireguard interface IP (24)"; + default = 24; + }; + }; + v6 = { + address = mkOption { + type = types.str; + description = "IP of the wireguard interface ()"; + }; + prefixLength = mkOption { + type = types.int; + description = "Prefix Length of the wireguard interface IP (24)"; + default = 64; + }; + ula = mkOption { + type = types.str; + description = "Unique Local Alloctation for IPv6 net"; + }; + gua = mkOption { + type = types.str; + description = + "Global Unique Allocation for IPv6 net, used as base for hosts"; + }; + }; + allowedIPs = mkOption { + type = types.listOf types.str; + description = "Extra allowedIPs"; + default = [ ]; + }; + }; + }; +} |
