os/modules/virtualisation/default.nix

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

56 lines
1 KiB
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
{
lib,
config,
pkgs,
...
}:
with lib; let
psCfg = config.pub-solar;
in {
2024-01-06 09:46:10 +00:00
boot.kernelParams = [
"amd_iommu=on"
"intel_iommu=on"
"iommu=pt"
];
2021-05-30 19:10:28 +00:00
2024-01-06 09:46:10 +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
2024-01-06 09:46:10 +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
2024-01-06 09:46:10 +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
};
2024-01-06 09:46:10 +00:00
systemd.tmpfiles.rules = [
"f /dev/shm/looking-glass 0660 ${psCfg.user.name} kvm"
];
#networking.bridges.virbr1.interfaces = [];
#networking.interfaces.virbr1 = {
# ipv4.addresses = [
# {
# address = "192.168.123.1";
# prefixLength = 24;
# }
# ];
#};
2021-05-30 19:10:28 +00:00
}