feat: upstream node generation

This commit is contained in:
Patrick 2025-02-06 21:14:42 +01:00
parent f1a3f0303b
commit 93b08971cf
No known key found for this signature in database
GPG key ID: 451F95EFB8BECD0F
9 changed files with 268 additions and 48 deletions

View file

@ -1,12 +1,14 @@
_guestName: guestCfg: {lib, ...}: let
inherit
(lib)
_guestName: guestCfg:
{ lib, ... }:
let
inherit (lib)
mkForce
nameValuePair
listToAttrs
flip
;
in {
in
{
node.name = guestCfg.nodeName;
node.type = guestCfg.backend;
@ -20,20 +22,20 @@ in {
systemd.network.networks = listToAttrs (
flip map guestCfg.networking.links (
name:
nameValuePair "10-${name}" {
matchConfig.Name = name;
DHCP = "yes";
# XXX: Do we really want this?
dhcpV4Config.UseDNS = false;
dhcpV6Config.UseDNS = false;
ipv6AcceptRAConfig.UseDNS = false;
networkConfig = {
IPv6PrivacyExtensions = "yes";
MulticastDNS = true;
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
}
nameValuePair "10-${name}" {
matchConfig.Name = name;
DHCP = "yes";
# XXX: Do we really want this?
dhcpV4Config.UseDNS = false;
dhcpV6Config.UseDNS = false;
ipv6AcceptRAConfig.UseDNS = false;
networkConfig = {
IPv6PrivacyExtensions = "yes";
MulticastDNS = true;
IPv6AcceptRA = true;
};
linkConfig.RequiredForOnline = "routable";
}
)
);
}