tweaking vm options
This commit is contained in:
parent
fc8642a2d0
commit
5f287a35c1
4 changed files with 48 additions and 36 deletions
47
core/virtualisation.nix
Normal file
47
core/virtualisation.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{ user, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
# Name of the group needed to use VirtualBox
|
||||
vmgroup = "vmusers";
|
||||
|
||||
in {
|
||||
|
||||
# Permissions configuration
|
||||
users = {
|
||||
# Gives users virtualisation permissions
|
||||
groups.kvm.members = [ "${user}" ];
|
||||
groups.libvirtd.members = [ "${user}" ];
|
||||
extraGroups."${vmgroup}".members = [ "${user}" ];
|
||||
users."${user}".extraGroups = [ "${vmgroup}" ];
|
||||
};
|
||||
|
||||
# Virtualisation packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
gnome-boxes # VM frontend
|
||||
dnsmasq # Vm networking
|
||||
phodav # Fileshare with guest VMs
|
||||
];
|
||||
|
||||
# Virtualisation configuration
|
||||
virtualisation = {
|
||||
# Base virtualisation set up
|
||||
libvirtd.enable = true;
|
||||
# TPM emulation for Win11
|
||||
libvirtd.qemu = {
|
||||
swtpm.enable = true;
|
||||
ovmf.packages = [ pkgs.OVMFFull.fd ];
|
||||
};
|
||||
# Enables USB passthrough
|
||||
spiceUSBRedirection.enable = true;
|
||||
# VirtualBox configuration
|
||||
virtualbox = {
|
||||
# Enables VirtualBox with this machine as the host
|
||||
#host.enable = false;
|
||||
# Increases security when using VirtualBox
|
||||
#host.enableHardening = true;
|
||||
# Needed for USB2 and USB3 passthrough
|
||||
#host.enableExtensionPack = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue