vm: Set up proper bridge networking

This commit is contained in:
Tristan Daniël Maat 2024-03-27 01:17:26 +01:00
parent d28979c61f
commit 14785afa14
Signed by: tlater
GPG key ID: 49670FD774E43268
7 changed files with 61 additions and 79 deletions
configuration
default.nix
hardware-specific

View file

@ -11,7 +11,6 @@
flake-inputs.sops-nix.nixosModules.sops
flake-inputs.tlaternet-webserver.nixosModules.default
"${modulesPath}/profiles/headless.nix"
"${modulesPath}/profiles/minimal.nix"
(import ../modules)

View file

@ -14,7 +14,9 @@
systemd.network.networks."10-eth0" = {
matchConfig.Name = "eth0";
networkConfig.DHCP = "yes";
networkConfig = {
Address = "192.168.9.2/24";
};
};
# Both so we have a predictable key for the staging env, as well as
@ -33,7 +35,18 @@
}
];
# # Set up VM settings to match real VPS
# virtualisation.memorySize = 3941;
# virtualisation.cores = 2;
virtualisation.vmVariant = {
virtualisation = {
memorySize = 3941;
cores = 2;
graphics = false;
};
virtualisation.qemu = {
networkingOptions = lib.mkForce [
"-device virtio-net,netdev=n1"
"-netdev bridge,id=n1,br=br0,helper=$(which qemu-bridge-helper)"
];
};
};
}