28 lines
727 B
Nix
28 lines
727 B
Nix
{ ... }: {
|
|
|
|
flake.nixosModules.default = { config, lib, pkgs, ... }: {
|
|
|
|
options.sysconfig.virtual-machines.enable = with lib; mkOption {
|
|
type = with types; bool;
|
|
default = false;
|
|
};
|
|
|
|
config = lib.mkIf config.sysconfig.virtual-machines.enable {
|
|
programs.virt-manager.enable = true;
|
|
|
|
virtualisation = {
|
|
libvirtd = {
|
|
enable = true;
|
|
qemu.swtpm.enable = true;
|
|
};
|
|
|
|
spiceUSBRedirection.enable = true;
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; lib.mkIf config.sysconfig.graphical [
|
|
virt-viewer
|
|
];
|
|
};
|
|
};
|
|
}
|