tweaking vm options
This commit is contained in:
parent
fc8642a2d0
commit
5f287a35c1
4 changed files with 48 additions and 36 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
# Host-specific core modules
|
# Host-specific core modules
|
||||||
../../../core/zfs.nix
|
../../../core/zfs.nix
|
||||||
../../../core/gaming.nix
|
../../../core/gaming.nix
|
||||||
|
../../../core/virtualisation.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# ooh, hostname - this one's important!
|
# ooh, hostname - this one's important!
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
{ user, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
|
|
||||||
# Name of the group needed to use VirtualBox
|
|
||||||
vboxgroup = "vmusers";
|
|
||||||
|
|
||||||
in {
|
|
||||||
|
|
||||||
# Permissions configuration
|
|
||||||
users = {
|
|
||||||
|
|
||||||
# Creates the group providing access to VirtualBox
|
|
||||||
extraGroups."${vboxgroup}".members = [ "user-with-access-to-virtualbox" ];
|
|
||||||
|
|
||||||
# Adds primary user to vboxusers group
|
|
||||||
users."${user}".extraGroups = [ "vboxusers" ];
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
# VirtualBox configuration
|
|
||||||
virtualisation.virtualbox = {
|
|
||||||
|
|
||||||
# Enables VirtualBox with this machine as the host
|
|
||||||
host.enable = true;
|
|
||||||
|
|
||||||
# Increases security when using VirtualBox
|
|
||||||
#host.enableHardening = true;
|
|
||||||
|
|
||||||
# Needed for USB2 and USB3 passthrough
|
|
||||||
host.enableExtensionPack = true;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -150,7 +150,6 @@ in {
|
||||||
# Desktop App Suite
|
# Desktop App Suite
|
||||||
gnome-calculator # Simple calculator
|
gnome-calculator # Simple calculator
|
||||||
appimage-run # Runs appimages
|
appimage-run # Runs appimages
|
||||||
gnome-boxes # Virtualisation host
|
|
||||||
file-roller # Simple archive manager
|
file-roller # Simple archive manager
|
||||||
themix-gui # GTK theme creation tool
|
themix-gui # GTK theme creation tool
|
||||||
nautilus # Simple file manager
|
nautilus # Simple file manager
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue