wireguard partial implementation

This commit is contained in:
2026-07-05 22:05:13 -05:00
parent dff5e2cb5e
commit bdba9806ec
+65
View File
@@ -0,0 +1,65 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.homelab.networking;
in
{
options.homelab.networking = {
enable = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable homelab networking support.";
};
# wireguard
wireguard = {
enable = lib.mkEnableOption "Wireguard support";
interfaces = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule {
options = {
enable = lib.mkEnableOption "Enable this WG interface";
address = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
privateKeyFile = lib.mkOption {
type = lib.types.str;
};
peers = lib.mkOption {
type = lib.types.listOf (
lib.types.submodule {
options = {
publicKey = lib.mkOption { type = lib.types.str; };
allowedIPs = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
};
endpoint = lib.mkOption {
type = lib.types.str;
default = "";
};
persistentKeepalive = lib.mkOption {
type = lib.types.nullOr lib.types.int;
default = null;
};
};
}
);
default = [ ];
};
};
}
);
};
};
};
}