nixos/modules/desktop/virtd.nix

32 lines
720 B
Nix
Raw Normal View History

2024-03-05 22:57:41 +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" = {
2024-03-05 22:57:41 +01:00
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
2023-10-09 17:38:02 +02:00
};
};
};
2023-10-11 15:16:16 +02:00
# Allow our user to use libvird
2024-03-05 22:57:41 +01:00
users.extraGroups.libvirtd.members = ["caspervk"];
2023-10-11 15:16:16 +02:00
2023-10-09 17:38:02 +02:00
# Persist libvirt data
environment.persistence."/nix/persist" = {
directories = [
2024-03-05 22:57:41 +01:00
{
directory = "/var/lib/libvirt";
user = "root";
group = "root";
mode = "0755";
}
2023-10-09 17:38:02 +02:00
];
};
}