Files
nixos/hosts/unstable/zeke/virt.nix
T
Greg Hellings e2181f124a
buildbot/nix-eval Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-exodus Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-isaiah Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-linode Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-zeke Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-jeremiah Build done.
buildbot/nix-build gitea:greg/nixos#checks.aarch64-linux.nixos-nixos Build done.
buildbot/nix-build gitea:greg/nixos#checks.x86_64-linux.nixos-gitlab Build done.
buildbot/nix-build Build done.
chore: dynamic hosts, builder targets
Make hosts read from directories, to limit manual changes
Rename vm-gitlab -> gitlab
A few reformatting and lint changes due to altered files
Create builder targets for Darwin builders
2026-02-17 16:11:29 -06:00

66 lines
1.3 KiB
Nix

{
lib,
pkgs,
...
}:
let
passthru = [
"1002:164e" # Raphael - embedded GPU
"1002:1640" # Rembrandt - Audio
#"10de:2507" # RTX 3050 video
#"10de:228e" # RTX 3050 audio
];
in
{
# These options enable sharing of the GPU with the VM
boot = {
# Order matters here, to prevent the AMD driver from getting to the driver before
# vfio-pci does
initrd.kernelModules = [
"vfio_pci"
"vfio"
"vfio_iommu_type1"
#"amdgpu"
#"nvidia"
#"nvidia_modeset"
#"nvidia_uvm"
#"nvidia_drm"
];
kernelParams = [
"amd_iommu=on"
"iommu=pt"
("vfio-pci.ids=" + (lib.concatStringsSep "," passthru))
];
};
hardware.graphics.enable = true;
systemd.services = {
"libvirt-nosleep@" = {
description = "Prevent sleep while %i is running";
serviceConfig = {
Type = "simple";
ExecStart = ''
${pkgs.systemd}/bin/systemd-inhibit --what=sleep --why="Libvirt domain %i is running" --who=%U --mode=block sleep infinity
'';
};
};
};
virtualisation = {
libvirtd = {
extraConfig = ''
log_filters="1:qemu"
log_outputs="1:file:/var/log/libvirt/libvirtd.log"
'';
hooks.qemu = {
win10 = lib.getExe pkgs.qemu-hook;
};
};
spiceUSBRedirection.enable = true;
};
}