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 = { config = {
frogeye = { frogeye = {
desktop.xorg = true; desktop.xorg = true;
dev.vm = true;
extra = true; extra = true;
}; };
}; };

View file

@ -6,16 +6,10 @@
}; };
dev = { dev = {
docker = true; docker = true;
vm = true;
}; };
extra = true; extra = true;
gaming = true; gaming = true;
storageSize = "big"; 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) [ ] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.fpga) [
yosys yosys
gtkwave gtkwave
# VM (graphical)
] ++ lib.optionals (config.frogeye.desktop.xorg && config.frogeye.dev.vm) [
virt-manager
]; ];
programs.nixvim.plugins.lsp.servers = { programs.nixvim.plugins.lsp.servers = {

View file

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

View file

@ -1,7 +1,17 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
{ {
config = lib.mkIf config.frogeye.dev.docker { config = lib.mkMerge [
virtualisation.docker.enable = true; (lib.mkIf config.frogeye.dev.docker {
users.users.geoffrey.extraGroups = [ "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" ];
})
];
} }