nix-config/modules/wg/options.nix

89 lines
2.6 KiB
Nix
Raw Permalink Normal View History

2025-01-04 21:07:54 +00:00
{
2025-01-11 03:55:19 +01:00
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;
};
2025-01-04 21:07:54 +00:00
2025-01-11 03:55:19 +01:00
hosts = mkOption {
default = { };
type = types.attrsOf (
types.submodule {
2025-01-04 21:07:54 +00:00
options = {
2025-01-11 03:55:19 +01:00
enable = mkOption {
type = types.bool;
default = true;
};
2025-01-04 21:07:54 +00:00
address = mkOption {
type = types.listOf types.str;
2025-01-11 03:55:19 +01:00
default = null;
2025-01-04 21:07:54 +00:00
};
publicKey = mkOption {
2025-01-11 03:55:19 +01:00
type = types.str;
default = null;
};
privateKeyFile = mkOption {
type = types.path;
default = null;
};
endpoint.enable = mkOption {
type = types.bool;
default = false;
};
endpoint.endpoint = mkOption {
2025-01-04 21:07:54 +00:00
type = types.nullOr types.str;
default = null;
};
2025-01-11 03:55:19 +01:00
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;
};
};
}
);
};
2025-01-04 21:07:54 +00:00
};
2025-01-11 03:55:19 +01:00
}
);
2025-01-04 21:07:54 +00:00
};
2025-01-11 03:55:19 +01:00
};
}
);
};
2025-01-04 21:07:54 +00:00
}