virt: add vagrant
This commit is contained in:
parent
29537a62b9
commit
83c3ea02b6
1 changed files with 21 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -14,4 +15,24 @@ mkIf (elem "virt-manager" config.machine.services) {
|
||||||
uris = [ "qemu:///system" ];
|
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";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue