nixos/modules/desktop/virtd.nix

27 lines
690 B
Nix
Raw Normal View History

2023-12-01 17:41:25 +01:00
{ home-manager, ... }: {
2023-10-09 17:38:02 +02:00
# https://nixos.wiki/wiki/Virt-manager
virtualisation.libvirtd.enable = true;
2023-12-01 17:41:25 +01:00
programs.virt-manager.enable = true;
2023-10-11 15:16:16 +02:00
2023-10-09 17:38:02 +02:00
# 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" ];
};
};
};
2023-10-11 15:16:16 +02:00
# Allow our user to use libvird
users.extraGroups.libvirtd.members = [ "caspervk" ];
2023-10-09 17:38:02 +02:00
# Persist libvirt data
environment.persistence."/nix/persist" = {
directories = [
{ directory = "/var/lib/libvirt"; user = "root"; group = "root"; mode = "0755"; }
];
};
}