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;
};
systemd.network = {
enable = true;
systemd = {
wait-online = {
anyInterface = true;
};
network = {
enable = true;
netdevs = {
"10-wghorus" = {
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;
};
}
];
wait-online = {
anyInterface = true;
};
};
networks = {
"40-enp4s0" = {
matchConfig = {
Name = "enp4s0";
};
netdevs = {
"10-wghorus" = {
netdevConfig = {
Kind = "wireguard";
MTUBytes = "1420";
Name = "wghorus";
};
networkConfig = {
DHCP = "yes";
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;
};
}
];
};
};
"40-wghorus" = {
matchConfig = {
Name = "wghorus";
networks = {
"40-enp4s0" = {
matchConfig = {
Name = "enp4s0";
};
networkConfig = {
DHCP = "yes";
};
};
"40-wghorus" = {
matchConfig = {
Name = "wghorus";
};
linkConfig = {
ActivationPolicy = "manual";
};
linkConfig = {
ActivationPolicy = "manual";
};
networkConfig = {
DHCP = "no";
DNS = "192.168.4.1";
Domains = [ "bedum.horus.nu" "internal.horus.nu" ];
};
networkConfig = {
DHCP = "no";
DNS = "192.168.4.1";
Domains = [ "bedum.horus.nu" "internal.horus.nu" ];
};
address = [
"10.10.4.2/24"
];
address = [
"10.10.4.2/24"
];
routes = [
{
routeConfig =
{
Destination = "192.168.4.0/23";
routes = [
{
routeConfig =
{
Destination = "192.168.4.0/23";
Scope = "link";
};
}
{
routeConfig = {
Destination = "192.168.6.0/24";
Scope = "link";
};
}
{
routeConfig = {
Destination = "192.168.6.0/24";
Scope = "link";
};
}
{
routeConfig =
{
Destination = "192.168.7.0/24";
Scope = "link";
};
}
{
routeConfig =
{
Destination = "192.168.8.0/24";
Scope = "link";
};
}
];
}
{
routeConfig =
{
Destination = "192.168.7.0/24";
Scope = "link";
};
}
{
routeConfig =
{
Destination = "192.168.8.0/24";
Scope = "link";
};
}
];
};
};
};
links = {
"40-enp4s0" = {
matchConfig = {
OriginalName = "enp4s0";
};
linkConfig = {
WakeOnLan = "magic";
links = {
"40-enp4s0" = {
matchConfig = {
OriginalName = "enp4s0";
};
linkConfig = {
WakeOnLan = "magic";
};
};
};
};