feat(libvirtd): adding virtualisation

This commit is contained in:
2025-09-16 08:54:20 +02:00
parent bc8b5449c7
commit a843e806bd
5 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
{
pkgs,
config,
lib,
...
}:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.nixos.services.libvirtd;
in
{
options = {
nixos.services.libvirtd.enable = mkEnableOption "Enables libvirtd";
};
config = mkIf cfg.enable {
networking.firewall.trustedInterfaces = [ "virbr0" ];
environment.systemPackages = with pkgs; [
virt-manager
virt-viewer
];
virtualisation = {
kvmgt.enable = true;
spiceUSBRedirection.enable = true;
libvirtd = {
enable = true;
onShutdown = "shutdown";
qemu = {
ovmf = {
enable = true;
packages = [ pkgs.OVMFFull.fd ];
};
};
};
};
};
}