initial
This commit is contained in:
35
hosts/sarien/system/virtual/libvirt.nix
Normal file
35
hosts/sarien/system/virtual/libvirt.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.virtual.libvirt;
|
||||
in {
|
||||
options = {
|
||||
virtual.libvirt.enable =
|
||||
mkEnableOption "enables virtualisation";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
package = pkgs.qemu_kvm;
|
||||
runAsRoot = false;
|
||||
swtpm.enable = true;
|
||||
vhostUserPackages = [pkgs.virtiofsd];
|
||||
ovmf = {
|
||||
enable = true;
|
||||
packages = [
|
||||
(pkgs.OVMF.override {
|
||||
secureBoot = true;
|
||||
tpmSupport = true;
|
||||
})
|
||||
.fd
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user