2023-01-28 20:49:10 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-06-13 00:14:25 +00:00
|
|
|
let
|
2021-05-30 19:10:28 +00:00
|
|
|
psCfg = config.pub-solar;
|
2023-01-28 20:49:10 +00:00
|
|
|
in
|
|
|
|
{
|
2023-11-10 18:48:06 +00:00
|
|
|
boot.kernelParams = [
|
|
|
|
"amd_iommu=on"
|
|
|
|
"intel_iommu=on"
|
|
|
|
"iommu=pt"
|
|
|
|
];
|
2021-05-30 19:10:28 +00:00
|
|
|
|
2023-11-10 18:48:06 +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
|
|
|
|
2023-11-10 18:48:06 +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
|
|
|
|
2023-11-10 18:48:06 +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
|
|
|
};
|
2023-11-10 18:48:06 +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
|
|
|
}
|