defiant: add libvirtd

This commit is contained in:
Felix Albrigtsen 2024-01-08 00:49:16 +01:00
parent 15b548894b
commit 4edeb7be23
2 changed files with 19 additions and 0 deletions

View File

@ -6,6 +6,7 @@
../../base.nix ../../base.nix
../../common/metrics-exporters.nix ../../common/metrics-exporters.nix
./hardware-configuration.nix ./hardware-configuration.nix
./libvirt.nix
./services/nginx.nix ./services/nginx.nix
./services/pihole.nix ./services/pihole.nix

18
hosts/defiant/libvirt.nix Normal file
View File

@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
{
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
boot.extraModprobeConfig = "options kvm_amd nested=1";
boot.kernelModules = [ "kvm-amd" "kvm-intel" ];
users.users.felixalb.extraGroups = [ "libvirtd" ];
fileSystems."/var/lib/libvirt/images" = {
device = "/tank/iso";
options = [ "bind" ];
};
# On a gui-enabled machine, connect with:
# $ virt-manager --connect "qemu+ssh://defiant/system?socket=/var/run/libvirt/libvirt-sock"
}