Hello, I created a PR for nixops-vbox plugin to extend its network capabilities. With this PR, user can define virtual networks and specify network adaptors explicitly for machines. It solves several itchy-spots when user wants to use virtualbox backend in some serious scenario. Though I think I’ve finished the initial development of my original idea, I’m still open to suggestions, advices and new requirements.
Here is the link to the PR:
https://github.com/nix-community/nixops-vbox/pull/2
And an example of what a deployment will look like with the newly supported network resources.
{
resources.virtualboxNetworks.host-net = {
type = "hostonly";
cidrBlock = "192.168.101.0/24";
staticIPs = {
"192.168.101.10" = "my-node"; # works in VirtualBox v6.1
};
};
my-node = { resources, lib, pkgs, ... }: {
deployment.targetEnv = "virtualbox";
deployment.virtualbox.headless = true;
deployment.virtualbox.networks = [
{ "type" = "nat"; }
resources.virtualboxNetworks.host-net
];
};
}
Appreciate for any feedback as well as code review.