66 lines
1.6 KiB
Nix
66 lines
1.6 KiB
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
inherit (lib) mkOption types;
|
|
cfg = config.pepe.core.network;
|
|
in
|
|
{
|
|
options.pepe.core.network = {
|
|
interfaceTypes = {
|
|
lan = mkOption {
|
|
type = types.str;
|
|
default = "lan";
|
|
description = "Key for LAN interface";
|
|
};
|
|
|
|
wan = mkOption {
|
|
type = types.str;
|
|
default = "wan";
|
|
description = "Key for WAN interface";
|
|
};
|
|
|
|
vpn = mkOption {
|
|
type = types.str;
|
|
default = "tailscale";
|
|
description = "Key for VPN interface";
|
|
};
|
|
};
|
|
|
|
interfaces = mkOption {
|
|
type = types.attrsOf (types.submodule {
|
|
options = {
|
|
interface = mkOption {
|
|
type = types.str;
|
|
description = "The network interface name.";
|
|
};
|
|
|
|
net = mkOption {
|
|
type = types.str;
|
|
description = "The network address in CIDR format.";
|
|
};
|
|
|
|
devices = mkOption {
|
|
type = types.attrsOf (types.submodule {
|
|
options = {
|
|
address = mkOption {
|
|
type = types.str;
|
|
description = "The IP address of the device.";
|
|
};
|
|
|
|
hostname = mkOption {
|
|
type = types.str;
|
|
description = "The hostname of the device.";
|
|
};
|
|
};
|
|
});
|
|
default = { };
|
|
description = "An attribute set of devices with their configurations.";
|
|
};
|
|
};
|
|
});
|
|
default = { };
|
|
description = "An attribute set of networks with their configurations.";
|
|
};
|
|
};
|
|
}
|