Convert Virtualbox to KVM

This commit is contained in:
Geoffrey Frogeye 2024-10-01 15:17:11 +02:00
parent 6618fbee9d
commit 5804ff31ff
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
5 changed files with 22 additions and 12 deletions

View file

@ -1,8 +1,9 @@
{ pkgs, lib, config, ... }:
{ ... }:
{
config = {
frogeye = {
desktop.xorg = true;
dev.vm = true;
extra = true;
};
};

View file

@ -6,16 +6,10 @@
};
dev = {
docker = true;
vm = true;
};
extra = true;
gaming = true;
storageSize = "big";
};
# Shenanigans
# nixpkgs.config.allowUnfree = true;
# virtualisation.virtualbox.host.enable = true;
# virtualisation.virtualbox.host.enableExtensionPack = true;
# users.extraGroups.vboxusers.members = [ "geoffrey" ];
# TODO Convert Windows VM from virtualbox to libvirt
}

View file

@ -54,6 +54,10 @@
] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [
yosys
gtkwave
# VM (graphical)
] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.vm) [
virt-manager
];
programs.nixvim.plugins.lsp.servers = {

View file

@ -50,6 +50,7 @@ in
php = lib.mkEnableOption "PHP dev stuff";
prose = lib.mkEnableOption "Writing stuff";
python = lib.mkEnableOption "Python dev stuff";
vm = lib.mkEnableOption "Virtual machines";
};
storageSize = lib.mkOption {
default = "small";

View file

@ -1,7 +1,17 @@
{ pkgs, lib, config, ... }:
{
config = lib.mkIf config.frogeye.dev.docker {
virtualisation.docker.enable = true;
users.users.geoffrey.extraGroups = [ "docker" ];
};
config = lib.mkMerge [
(lib.mkIf config.frogeye.dev.docker {
virtualisation.docker.enable = true;
users.users.geoffrey.extraGroups = [ "docker" ];
})
(lib.mkIf config.frogeye.dev.vm {
virtualisation = {
libvirtd.enable = true;
spiceUSBRedirection.enable = true;
};
users.extraGroups.libvirtd.members = [ "geoffrey" ];
})
];
}