os/profiles/virt/default.nix
2020-12-15 21:41:19 -07:00

30 lines
732 B
Nix

{ pkgs, ... }: {
virtualisation.libvirtd = {
enable = true;
qemuRunAsRoot = false;
};
# you'll need to add your user to 'libvirtd' group to use virt-manager
environment.systemPackages = with pkgs; [ virt-manager vagrant ];
environment.sessionVariables = {
VAGRANT_DEFAULT_PROVIDER = "libvirt";
};
nixpkgs.overlays =
let
overlay = final: prev: {
# Patch libvirt to use ebtables-legacy
libvirt =
if prev.libvirt.version <= "5.4.0" && prev.ebtables.version
> "2.0.10-4" then
prev.libvirt.overrideAttrs (o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; })
else
prev.libvirt;
};
in
[ overlay ];
}