feat: use mainGateway for idols-ai, rename defaultGateway to proxyGateway

This commit is contained in:
Ryan Yin
2025-08-11 00:31:55 +08:00
parent 01448b6e0e
commit 3c409bd83a
7 changed files with 85 additions and 90 deletions

View File

@@ -11,11 +11,10 @@
let
hostName = "ruby"; # Define your hostname.
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
inherit (myvars.networking) proxyGateway proxyGateway6 nameservers;
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
ipv4WithMask = "${ipv4}/24";
in
{
in {
imports = mylib.scanPaths ./.;
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
@@ -35,7 +34,7 @@ in
"exfat"
];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelModules = ["kvm-amd"];
boot.extraModprobeConfig = "options kvm_amd nested=1"; # for amd cpu
networking = {
@@ -50,9 +49,9 @@ in
systemd.network.enable = true;
systemd.network.networks."10-${iface}" = {
matchConfig.Name = [ iface ];
matchConfig.Name = [iface];
networkConfig = {
Address = [ ipv4WithMask ];
Address = [ipv4WithMask];
DNS = nameservers;
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
@@ -61,11 +60,11 @@ in
routes = [
{
Destination = "0.0.0.0/0";
Gateway = defaultGateway;
Gateway = proxyGateway;
}
{
Destination = "::/0";
Gateway = defaultGateway6;
Gateway = proxyGateway6;
GatewayOnLink = true; # it's a gateway on local link.
}
];