Flake for my NixOS devices
1{...}: {
2 config,
3 lib,
4 pkgs,
5 ...
6}: {
7 options.cow.hypervisor = {
8 enable = lib.mkEnableOption "Enable running VMs";
9 };
10
11 config = lib.mkIf config.cow.hypervisor.enable {
12 users.users.bean.extraGroups = lib.mkIf config.cow.bean.enable ["libvirtd"];
13
14 cow.imperm.keepCache = ["/var/lib/libvirt"];
15
16 programs.virt-manager.enable = config.cow.gdi.enable;
17
18 environment.systemPackages = with pkgs; [
19 libtpms # For win 11
20 ];
21
22 virtualisation.libvirtd = {
23 enable = true;
24 qemu.swtpm.enable = true; # Win 11
25 onBoot = "ignore"; # I don't want VMs to start again on reboot
26 };
27 };
28}