From 3572c93df4290811be0e558f66040d7be2ab6125 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Sat, 4 Jan 2025 21:07:54 +0000 Subject: add wg module --- modules/wg/options.nix | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 modules/wg/options.nix (limited to 'modules/wg/options.nix') diff --git a/modules/wg/options.nix b/modules/wg/options.nix new file mode 100644 index 0000000..4f090d0 --- /dev/null +++ b/modules/wg/options.nix @@ -0,0 +1,79 @@ +{ lib +, ...}: +{ + options.oxalab.wg = with lib; + lib.mkOption { + default = []; + type = types.listOf (types.submodule { + options = { + # general network stuff + networkName = mkOption { + type = types.nullOr types.str; + default = null; + }; + CIDRs = mkOption { + type = types.nullOr (types.listOf types.str); + default = null; + }; + + hosts = mkOption { + default = {}; + type = types.attrsOf (types.submodule { + options = { + + enable = mkOption { + type = types.bool; + default = true; + }; + address = mkOption { + type = types.listOf types.str; + default = null; + }; + publicKey = mkOption { + type = types.str; + default = null; + }; + privateKeyFile = mkOption { + type = types.path; + default = null; + }; + + endpoint.enable = mkOption { + type = types.bool; + default = false; + }; + endpoint.endpoint = mkOption { + type = types.nullOr types.str; + default = null; + }; + endpoint.port = mkOption { + type = types.nullOr types.int; + default = null; + }; + endpoint.publicIface = mkOption { + type = types.nullOr types.str; + default = null; + }; + + endpoint.extraPeers = mkOption { + default = []; + type = types.listOf (types.submodule { + options = { + address = mkOption { + type = types.listOf types.str; + default = []; + }; + publicKey = mkOption { + type = types.nullOr types.str; + default = null; + }; + }; + }); + }; + }; + }); + }; + }; + }); + }; +} -- cgit v1.3.1