diff --git a/services/virt-manager.nix b/services/virt-manager.nix index 6e97a1b..471380e 100644 --- a/services/virt-manager.nix +++ b/services/virt-manager.nix @@ -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"; + }; }