loki: Minor restructuring of systemd config

This commit is contained in:
Erwin Boskma 2024-01-06 13:45:30 +01:00
parent 4495a65881
commit 0f6d55acbb
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk

View file

@ -199,107 +199,110 @@
sudo.enable = false; sudo.enable = false;
}; };
systemd.network = { systemd = {
enable = true;
wait-online = { network = {
anyInterface = true; enable = true;
};
netdevs = { wait-online = {
"10-wghorus" = { anyInterface = true;
netdevConfig = {
Kind = "wireguard";
MTUBytes = "1420";
Name = "wghorus";
};
wireguardConfig = {
PrivateKeyFile = config.sops.secrets.wireguard-horus-privkey.path;
ListenPort = 51820;
};
wireguardPeers = [
{
wireguardPeerConfig = {
PublicKey = "6faxlUG8+F7uVrKk/OJqqy5k2+OzrhXc/cV6Zsfbl0c=";
AllowedIPs = [ "192.168.4.0/23" "192.168.6.0/24" "192.168.7.0/24" "192.168.8.0/24" ];
Endpoint = "212.45.34.195:51820";
PersistentKeepalive = 25;
};
}
];
}; };
};
networks = { netdevs = {
"40-enp4s0" = { "10-wghorus" = {
matchConfig = { netdevConfig = {
Name = "enp4s0"; Kind = "wireguard";
}; MTUBytes = "1420";
Name = "wghorus";
};
networkConfig = { wireguardConfig = {
DHCP = "yes"; PrivateKeyFile = config.sops.secrets.wireguard-horus-privkey.path;
ListenPort = 51820;
};
wireguardPeers = [
{
wireguardPeerConfig = {
PublicKey = "6faxlUG8+F7uVrKk/OJqqy5k2+OzrhXc/cV6Zsfbl0c=";
AllowedIPs = [ "192.168.4.0/23" "192.168.6.0/24" "192.168.7.0/24" "192.168.8.0/24" ];
Endpoint = "212.45.34.195:51820";
PersistentKeepalive = 25;
};
}
];
}; };
}; };
"40-wghorus" = {
matchConfig = { networks = {
Name = "wghorus"; "40-enp4s0" = {
matchConfig = {
Name = "enp4s0";
};
networkConfig = {
DHCP = "yes";
};
}; };
"40-wghorus" = {
matchConfig = {
Name = "wghorus";
};
linkConfig = { linkConfig = {
ActivationPolicy = "manual"; ActivationPolicy = "manual";
}; };
networkConfig = { networkConfig = {
DHCP = "no"; DHCP = "no";
DNS = "192.168.4.1"; DNS = "192.168.4.1";
Domains = [ "bedum.horus.nu" "internal.horus.nu" ]; Domains = [ "bedum.horus.nu" "internal.horus.nu" ];
}; };
address = [ address = [
"10.10.4.2/24" "10.10.4.2/24"
]; ];
routes = [ routes = [
{ {
routeConfig = routeConfig =
{ {
Destination = "192.168.4.0/23"; Destination = "192.168.4.0/23";
Scope = "link";
};
}
{
routeConfig = {
Destination = "192.168.6.0/24";
Scope = "link"; Scope = "link";
}; };
} }
{ {
routeConfig = { routeConfig =
Destination = "192.168.6.0/24"; {
Scope = "link"; Destination = "192.168.7.0/24";
}; Scope = "link";
} };
{ }
routeConfig = {
{ routeConfig =
Destination = "192.168.7.0/24"; {
Scope = "link"; Destination = "192.168.8.0/24";
}; Scope = "link";
} };
{ }
routeConfig = ];
{ };
Destination = "192.168.8.0/24";
Scope = "link";
};
}
];
}; };
};
links = { links = {
"40-enp4s0" = { "40-enp4s0" = {
matchConfig = { matchConfig = {
OriginalName = "enp4s0"; OriginalName = "enp4s0";
}; };
linkConfig = { linkConfig = {
WakeOnLan = "magic"; WakeOnLan = "magic";
};
}; };
}; };
}; };