Virt-manager configuration with win11 vm
This commit is contained in:
parent
9516c2b85f
commit
2ff406b621
5 changed files with 94 additions and 2 deletions
|
@ -16,8 +16,9 @@
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
./modules/fish
|
./modules/fish
|
||||||
./modules/steam
|
|
||||||
./modules/gnome
|
./modules/gnome
|
||||||
|
./modules/steam
|
||||||
|
./modules/vm
|
||||||
];
|
];
|
||||||
|
|
||||||
## NETWORKING ##
|
## NETWORKING ##
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
# Modules
|
# Modules
|
||||||
../modules/gnome/home.nix
|
../modules/gnome/home.nix
|
||||||
../modules/fish
|
../modules/vm/home.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enables app shorcuts
|
# Enables app shorcuts
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
favorite-apps = [
|
favorite-apps = [
|
||||||
"org.gnome.Nautilus.desktop"
|
"org.gnome.Nautilus.desktop"
|
||||||
"org.wezfurlong.wezterm.desktop"
|
"org.wezfurlong.wezterm.desktop"
|
||||||
|
"win11.desktop"
|
||||||
"zen.desktop"
|
"zen.desktop"
|
||||||
"spotify.desktop"
|
"spotify.desktop"
|
||||||
"vesktop.desktop"
|
"vesktop.desktop"
|
||||||
|
|
56
host/rune/modules/vm/default.nix
Normal file
56
host/rune/modules/vm/default.nix
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
admin,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
|
# Enable dconf (System Management Tool)
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
|
# Add user to libvirtd group
|
||||||
|
users.users.${admin}.extraGroups = [ "libvirtd" ];
|
||||||
|
|
||||||
|
# Install necessary packages
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
qemu
|
||||||
|
qemu_kvm
|
||||||
|
spice
|
||||||
|
spice-gtk
|
||||||
|
spice-protocol
|
||||||
|
virtiofsd
|
||||||
|
win-spice
|
||||||
|
win-virtio
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPortRanges = [
|
||||||
|
# spice
|
||||||
|
{
|
||||||
|
from = 5900;
|
||||||
|
to = 5999;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
allowedTCPPorts = [
|
||||||
|
# libvirt
|
||||||
|
16509
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.virt-manager.enable = true;
|
||||||
|
virtualisation = {
|
||||||
|
libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
runAsRoot = true;
|
||||||
|
swtpm.enable = true;
|
||||||
|
ovmf.enable = true;
|
||||||
|
ovmf.packages = with pkgs; [ OVMFFull.fd ];
|
||||||
|
vhostUserPackages = with pkgs; [ virtiofsd ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
spiceUSBRedirection.enable = true;
|
||||||
|
};
|
||||||
|
services.spice-vdagentd.enable = true;
|
||||||
|
}
|
34
host/rune/modules/vm/home.nix
Normal file
34
host/rune/modules/vm/home.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
dconf.settings = {
|
||||||
|
"org/virt-manager/virt-manager/connections" = {
|
||||||
|
autoconnect = [
|
||||||
|
"qemu:///session"
|
||||||
|
"qemu:///system"
|
||||||
|
];
|
||||||
|
uris = [
|
||||||
|
"qemu:///session"
|
||||||
|
"qemu:///system"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.desktopEntries = {
|
||||||
|
win11 = {
|
||||||
|
name = "Windows 11";
|
||||||
|
comment = "Windows 11 VM";
|
||||||
|
exec = "virt-manager --connect qemu:///system --show-domain-console win11-sys";
|
||||||
|
icon = "windows95";
|
||||||
|
type = "Application";
|
||||||
|
terminal = false;
|
||||||
|
categories = [
|
||||||
|
"System"
|
||||||
|
"Application"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue