virt: add vagrant

This commit is contained in:
Kevin Baensch 2024-12-14 21:58:45 +01:00
parent 29537a62b9
commit 83c3ea02b6
Signed by: derped
GPG key ID: C0F1D326C7626543

View file

@ -1,6 +1,7 @@
{
config,
lib,
pkgs,
...
}:
@ -14,4 +15,24 @@ mkIf (elem "virt-manager" config.machine.services) {
uris = [ "qemu:///system" ];
};
};
services.nfs.server.enable = true;
# rule for vagrant virtualbox provider.
networking.firewall.extraCommands = lib.optionalString (config.virtualisation.virtualbox.host.enable) ''
ip46tables -I INPUT 1 -i vboxnet+ -p tcp -m tcp --dport 2049 -j ACCEPT
'';
# Add firewall exception for libvirt provider when using NFSv4
networking.firewall.interfaces."virbr1" = {
allowedTCPPorts = [ 2049 ];
allowedUDPPorts = [ 2049 ];
};
environment = {
systemPackages = with pkgs; [
vagrant
];
variables.VAGRANT_DEFAULT_PROVIDER = "libvirt";
};
}