113 lines
2.2 KiB
Nix
113 lines
2.2 KiB
Nix
{ lib, ... }:
|
|
with lib;
|
|
let
|
|
interfaceSubmodule = types.submodule {
|
|
options = {
|
|
name = mkOption {
|
|
type = types.str;
|
|
description = "Name of the network interface (e.g., enp1s0)";
|
|
};
|
|
ip = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
description = "Static IP address (optional). If null, no static IP is assigned.";
|
|
};
|
|
speed = mkOption {
|
|
type = types.nullOr types.int;
|
|
default = null;
|
|
description = "Link speed in Mbps (optional). If null, auto-negotiation is used.";
|
|
};
|
|
prefixLength = mkOption {
|
|
type = types.int;
|
|
default = 24;
|
|
description = "Subnet prefix length (default 24).";
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
options.vars = {
|
|
|
|
# WIREGUARD
|
|
wg_interface = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_local_ip = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_adress = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_range = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_privateKey = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_publicKey = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_presharedKey = mkOption {
|
|
type = types.str;
|
|
};
|
|
wg_endpoint = mkOption {
|
|
type = types.str;
|
|
};
|
|
|
|
# SYSTEM
|
|
username = mkOption {
|
|
type = types.str;
|
|
};
|
|
usermail = mkOption {
|
|
type = types.str;
|
|
};
|
|
local_ip = mkOption {
|
|
type = types.str;
|
|
};
|
|
hostname = mkOption {
|
|
type = types.str;
|
|
};
|
|
hostid = mkOption {
|
|
type = types.str;
|
|
};
|
|
host_type = mkOption {
|
|
type = types.str;
|
|
};
|
|
stateVersion = mkOption {
|
|
type = types.str;
|
|
};
|
|
interfaces = mkOption {
|
|
type = types.listOf interfaceSubmodule;
|
|
default = [];
|
|
};
|
|
# KEEPALIVED
|
|
ka_addr_v4 = mkOption {
|
|
type = types.str;
|
|
};
|
|
ka_addr_v6 = mkOption {
|
|
type = types.str;
|
|
};
|
|
ka_priority = mkOption {
|
|
type = types.int;
|
|
};
|
|
|
|
|
|
# Homemanager
|
|
hm_git_username = mkOption {
|
|
type = types.str;
|
|
};
|
|
|
|
|
|
# NFS
|
|
nfs_server = mkOption {
|
|
type = types.str;
|
|
};
|
|
nfs_volume = mkOption {
|
|
type = types.str;
|
|
};
|
|
nfs_mount = mkOption {
|
|
type = types.str;
|
|
};
|
|
};
|
|
}
|