nixos: Internal network tidying

This commit is contained in:
Jack O'Sullivan 2022-05-18 23:29:52 +01:00
parent 0a5a554ab3
commit b504f11c6b
4 changed files with 18 additions and 8 deletions

View File

@ -22,6 +22,8 @@
{ {
imports = [ "${modulesPath}/profiles/qemu-guest.nix" ]; imports = [ "${modulesPath}/profiles/qemu-guest.nix" ];
networking.domain = "nl1.int.nul.ie";
boot.kernelParams = [ "intel_iommu=on" ]; boot.kernelParams = [ "intel_iommu=on" ];
boot.loader.systemd-boot.configurationLimit = 20; boot.loader.systemd-boot.configurationLimit = 20;
fileSystems = { fileSystems = {
@ -50,20 +52,24 @@
pciutils pciutils
]; ];
networking = {
interfaces = mkIf (!config.my.build.isDevVM) {
enp10s0.useDHCP = true;
};
};
systemd = { systemd = {
network = { network = {
links = {
"10-base-ext" = {
matchConfig.MACAddress = "52:54:00:81:bd:a1";
linkConfig.Name = "base-ext";
};
};
netdevs."25-base".netdevConfig = { netdevs."25-base".netdevConfig = {
Name = "base"; Name = "base";
Kind = "bridge"; Kind = "bridge";
}; };
networks = { networks = {
"80-base" = networkdAssignment "base" assignments.internal; "80-base" = networkdAssignment "base" assignments.internal;
"80-base-ext" = {
matchConfig.Name = "base-ext";
networkConfig.Bridge = "base";
};
"80-vm-tap" = { "80-vm-tap" = {
matchConfig = { matchConfig = {
# Don't think we have control over the name of the TAP from qemu-bridge-helper (or how to easily pick # Don't think we have control over the name of the TAP from qemu-bridge-helper (or how to easily pick

View File

@ -60,7 +60,7 @@ let
}; };
system.name = name; system.name = name;
networking.hostName = mkDefault name; networking.hostName = mkDefault (config'.assignments.internal.name or name);
nixpkgs = { nixpkgs = {
inherit (config') system; inherit (config') system;
# Make sure any previously set overlays (e.g. lib which will be inherited by home-manager down the # Make sure any previously set overlays (e.g. lib which will be inherited by home-manager down the

View File

@ -11,6 +11,8 @@ in
enableIPv6 = mkDefault true; enableIPv6 = mkDefault true;
useNetworkd = mkDefault true; useNetworkd = mkDefault true;
}; };
services.resolved.domains = [ config.networking.domain ];
} }
(mkIf config.my.build.isDevVM { (mkIf config.my.build.isDevVM {

View File

@ -5,7 +5,7 @@
home-manager = "unstable"; home-manager = "unstable";
assignments.internal = { assignments.internal = {
name = "estuary.vm"; name = "estuary-vm";
altNames = [ "fw" ]; altNames = [ "fw" ];
ipv4 = { ipv4 = {
address = "10.100.0.1"; address = "10.100.0.1";
@ -24,6 +24,8 @@
config = mkMerge [ config = mkMerge [
{ {
networking.domain = "nl1.int.nul.ie";
boot.kernelParams = [ "console=ttyS0,115200n8" ]; boot.kernelParams = [ "console=ttyS0,115200n8" ];
fileSystems = { fileSystems = {
"/boot" = { "/boot" = {