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" ];
networking.domain = "nl1.int.nul.ie";
boot.kernelParams = [ "intel_iommu=on" ];
boot.loader.systemd-boot.configurationLimit = 20;
fileSystems = {
@ -50,20 +52,24 @@
pciutils
];
networking = {
interfaces = mkIf (!config.my.build.isDevVM) {
enp10s0.useDHCP = true;
};
};
systemd = {
network = {
links = {
"10-base-ext" = {
matchConfig.MACAddress = "52:54:00:81:bd:a1";
linkConfig.Name = "base-ext";
};
};
netdevs."25-base".netdevConfig = {
Name = "base";
Kind = "bridge";
};
networks = {
"80-base" = networkdAssignment "base" assignments.internal;
"80-base-ext" = {
matchConfig.Name = "base-ext";
networkConfig.Bridge = "base";
};
"80-vm-tap" = {
matchConfig = {
# 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;
networking.hostName = mkDefault name;
networking.hostName = mkDefault (config'.assignments.internal.name or name);
nixpkgs = {
inherit (config') system;
# 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;
useNetworkd = mkDefault true;
};
services.resolved.domains = [ config.networking.domain ];
}
(mkIf config.my.build.isDevVM {

View File

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