os/modules/virtualisation/default.nix

47 lines
842 B
Nix

{
lib,
config,
pkgs,
...
}:
with lib; let
psCfg = config.pub-solar;
in {
boot.kernelParams = [
"amd_iommu=on"
"intel_iommu=on"
"iommu=pt"
];
virtualisation.libvirtd = {
enable = true;
qemu.ovmf.enable = true;
};
users.users."${psCfg.user.name}" = {
extraGroups = ["libvirtd"];
};
environment.systemPackages = with pkgs; [
libvirt
libvirt-glib
qemu
virt-manager
python3Packages.libvirt
gvfs
edk2
OVMF
win-virtio
looking-glass-client
lgcl
];
home-manager.users."${psCfg.user.name}" = {
xdg.dataFile."libvirt/.keep".text = "# this file is here to generate the directory";
home.packages = [pkgs.obs-studio-plugins.looking-glass-obs];
};
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 ${psCfg.user.name} kvm"
];
}