os/modules/virtualisation/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
842 B
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{
lib,
config,
pkgs,
...
}:
with lib; let
psCfg = config.pub-solar;
in {
boot.kernelParams = [
"amd_iommu=on"
"intel_iommu=on"
"iommu=pt"
];
2021-05-30 19:10:28 +00:00
virtualisation.libvirtd = {
enable = true;
qemu.ovmf.enable = true;
};
users.users."${psCfg.user.name}" = {
extraGroups = ["libvirtd"];
};
2021-05-30 19:10:28 +00:00
environment.systemPackages = with pkgs; [
libvirt
libvirt-glib
qemu
virt-manager
python3Packages.libvirt
gvfs
edk2
OVMF
win-virtio
looking-glass-client
lgcl
];
2021-05-30 19:10:28 +00:00
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];
};
2021-05-30 19:10:28 +00:00
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 ${psCfg.user.name} kvm"
];
2021-05-30 19:10:28 +00:00
}