nixos/modules/desktop/virtd.nix

32 lines
719 B
Nix
Raw Normal View History

2024-03-05 22:57:41 +01:00
{home-manager, ...}: {
2024-06-27 20:37:34 +02:00
# https://wiki.nixos.org/wiki/Virt-manager
2023-10-09 17:38:02 +02:00
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-04-06 01:20:19 +02:00
users.groups.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
];
};
}