diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-11-01 15:36:27 -0400 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-11-01 15:36:27 -0400 |
| commit | 2ac3278b4ac7bc638786a28f785230bed5370862 (patch) | |
| tree | bc51f9b6384da5f471241af0cbac6e15a1a7abcf /nixos | |
| parent | 5d25d192a4af921b1647b88af377463b45e02fc3 (diff) | |
| download | home-2ac3278b4ac7bc638786a28f785230bed5370862.tar.gz | |
nixos/libvirt: init
Diffstat (limited to 'nixos')
| -rw-r--r-- | nixos/libvirt.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/libvirt.nix b/nixos/libvirt.nix new file mode 100644 index 0000000..a787be9 --- /dev/null +++ b/nixos/libvirt.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.nixos; +in +{ + options.nixos.libvirt = { + enable = lib.mkEnableOption "libvirt"; + }; + config = lib.mkIf config.nixos.libvirt.enable { + programs.virt-manager.enable = true; + users.groups.libvirtd.members = [ "${cfg.username}" ]; + virtualisation.libvirtd = { + enable = true; + qemu.vhostUserPackages = [ pkgs.virtiofsd ]; + }; + virtualisation.spiceUSBRedirection.enable = true; + }; +} |