diff options
| author | Grisha Shipunov | 2025-01-11 03:55:19 +0100 |
|---|---|---|
| committer | Grisha Shipunov | 2025-01-11 03:55:19 +0100 |
| commit | 62e2519639faa250f43f9e80e69906a59d07a44e (patch) | |
| tree | 08d662d7674904d566d2dd7ccf85affb9ddd7cd9 /modules/wg/options.nix | |
| parent | 595d4935de99cc2ff10be9eaddac498c7c38489f (diff) | |
delete legacy stuff and reformat
Diffstat (limited to 'modules/wg/options.nix')
| -rw-r--r-- | modules/wg/options.nix | 141 |
1 files changed, 75 insertions, 66 deletions
diff --git a/modules/wg/options.nix b/modules/wg/options.nix index 4f090d0..56fd964 100644 --- a/modules/wg/options.nix +++ b/modules/wg/options.nix @@ -1,79 +1,88 @@ -{ 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; - }; + 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; + }; - endpoint.extraPeers = mkOption { - default = []; - type = types.listOf (types.submodule { + hosts = mkOption { + default = { }; + type = types.attrsOf ( + types.submodule { options = { + + enable = mkOption { + type = types.bool; + default = true; + }; address = mkOption { type = types.listOf types.str; - default = []; + 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; + }; + }; + } + ); + }; }; - }); - }; + } + ); }; - }); - }; - }; - }); - }; + }; + } + ); + }; } |
