nixos-configs/modules/services/libvirt.nix

22 lines
438 B
Nix
Raw Normal View History

2023-03-21 14:42:39 +01:00
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.services.libvirt;
in {
options.modules.services.libvirt = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
virtualisation = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
2023-03-23 01:56:21 +01:00
users.users.${config.user.name}.extraGroups = [ "libvirtd" ];
2023-03-21 14:42:39 +01:00
environment.systemPackages = with pkgs; [ virt-manager ];
};
}