📦 darkone.host.gateway
The main gateway / router of a local network zone.
Sub-module (gateway/): backup-links.nix, backup uplinks.
Backup uplinks (backup-links.nix)
Section titled “Backup uplinks (backup-links.nix)”Options
Section titled “Options”- enable
boolEnable gateway features for the current host (dhcp, dns, proxy, etc.) - wanSsh.enable
boolPublic SSH on the WAN interface, to reach a remote gateway not yet on the tailnet
darkone.host.gateway = { enable = false; wanSsh.enable = dnfLib.gatewayAwaitsTailnet network zone;};gateway/backup-links.nix
Section titled “gateway/backup-links.nix”- backupLinks
attrsFallback uplinks, used when the WAN has no link, no lease or no Internet. Name:[a-z][a-z0-9-]*.- type
enum [ "ethernet" "wifi" ]ethernet: DHCP client on a spare port, always up.wifi: WPA2/WPA3 client, radio off (rfkill) until no preferred link reaches the Internet; SSID and passphrase are read from sops (backup-link/<name>/ssid,backup-link/<name>/psk). - interface
strInterface carrying the link: neither the WAN, a LAN port nor a hostapd radio. - priority
ints.between 1 99Lower is preferred among backup links (route metric 200 + 10 × priority, the WAN staying at 100).
- type
- linkCheck.targets
nonEmptyListOf strIP addresses pinged through each uplink; one answer is enough. IP literals only: the probe must not depend on DNS. - linkCheck.interval
ints.positiveSeconds between two probe rounds. - linkCheck.failAfter
ints.positiveFailed rounds before an uplink is penalised. - linkCheck.recoverAfter
ints.positiveGood rounds before a penalised uplink is restored (hysteresis).
darkone.host.gateway = { backupLinks.type = null; backupLinks.interface = "wlp4s0"; backupLinks.priority = 10; linkCheck.targets = internetProbeTargets; linkCheck.interval = 10; linkCheck.failAfter = 3; linkCheck.recoverAfter = 6;};Source: modules/mixin/host/gateway.nix 🡕