This commit is contained in:
mjallen18
2025-09-03 17:54:33 -05:00
parent 67b840c40f
commit c4911b9d5f
31 changed files with 339 additions and 223 deletions

View File

@@ -8,7 +8,7 @@ with lib;
let
cfg = config.${namespace}.network;
profiles =
profiles =
let
make =
name: profile:
@@ -21,16 +21,19 @@ let
autoconnect-priority = profile.priority;
interface-name = cfg.ipv4.interface;
};
ipv4 =
{
method = cfg.ipv4.method;
} // (if (cfg.ipv4.method == "auto") then { }
else
{
address = cfg.ipv4.address;
gateway = cfg.ipv4.gateway;
dns = cfg.ipv4.dns;
});
ipv4 = {
method = cfg.ipv4.method;
}
// (
if (cfg.ipv4.method == "auto") then
{ }
else
{
address = cfg.ipv4.address;
gateway = cfg.ipv4.gateway;
dns = cfg.ipv4.dns;
}
);
ipv6 = {
addr-gen-mode = "stable-privacy";
method = "auto";

View File

@@ -53,30 +53,40 @@ in
powersave = mkBoolOpt false "Whether to enable WiFi power saving.";
profiles = mkOpt (types.attrsOf (
types.submodule {
options = {
ssid = mkOpt types.str "" "SSID of the WiFi network.";
profiles =
mkOpt
(types.attrsOf (
types.submodule {
options = {
ssid = mkOpt types.str "" "SSID of the WiFi network.";
type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)";
type = mkOpt types.str "wifi" "type of the network.(wifi/ethernet)";
autoconnect = mkBoolOpt true "autoconnect to this connection";
autoconnect = mkBoolOpt true "autoconnect to this connection";
autoconnect-retries = mkOpt types.int (-1) "The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden)";
autoconnect-retries =
mkOpt types.int (-1)
"The number of times a connection should be tried when autoactivating before giving up. Zero means forever, -1 means the global default (4 times if not overridden)";
priority = mkOpt types.int 0 "connection priority in range -999 to 999. The higher number means higher priority.";
priority =
mkOpt types.int 0
"connection priority in range -999 to 999. The higher number means higher priority.";
psk = mkOpt types.str "$PSK" "PSK environment variable for the WiFi password.";
psk = mkOpt types.str "$PSK" "PSK environment variable for the WiFi password.";
keyMgmt = mkOpt types.str "sae" "Key management type (e.g., sae, wpa-psk).";
keyMgmt = mkOpt types.str "sae" "Key management type (e.g., sae, wpa-psk).";
};
}
))
{
"Joey's Jungle 6G" = {
priority = -900;
};
"Joey's Jungle 5G" = {
priority = -999;
};
}
))
{
"Joey's Jungle 6G" = { priority = -900; };
"Joey's Jungle 5G" = { priority = -999; };
}
"network profiles.";
"network profiles.";
};
hostId = mkOpt types.str "" "Host ID for ZFS and other services.";