nixos/modules/desktop/virtd.nix
Casper V. Kristensen a03b76bc84 virtd
2023-10-09 17:38:02 +02:00

25 lines
710 B
Nix

{ home-manager, pkgs, ... }: {
# https://nixos.wiki/wiki/Virt-manager
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true; # virt-manager requires dconf to remember settings
environment.systemPackages = with pkgs; [ virt-manager ];
# Make virt-manager use QEMU/KVM by default
home-manager.users.caspervk = {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = [ "qemu:///system" ];
uris = [ "qemu:///system" ];
};
};
};
# Persist libvirt data
environment.persistence."/nix/persist" = {
directories = [
{ directory = "/var/lib/libvirt"; user = "root"; group = "root"; mode = "0755"; }
];
};
}