modules/virtualization: refactor

This commit is contained in:
Infinidoge 2024-07-26 10:53:16 -04:00
parent 421d490af1
commit b0ae389685
Signed by: Infinidoge
SSH key fingerprint: SHA256:oAMyvotlNFraMmZmr+p6AxnNfW/GioTs1pOn3V4tQ7A
4 changed files with 16 additions and 13 deletions

View file

@ -48,7 +48,6 @@
gaming.enableAll = true; gaming.enableAll = true;
gaming.olympus.enable = false; # Build is currently broken gaming.olympus.enable = false; # Build is currently broken
}; };
virtualization.enable = true;
software.minipro.enable = true; software.minipro.enable = true;
backups.extraExcludes = [ backups.extraExcludes = [
@ -56,6 +55,8 @@
]; ];
}; };
virtualisation.enable = true;
home = { pkgs, ... }: { home = { pkgs, ... }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
arduino arduino

View file

@ -30,11 +30,12 @@
modules = { modules = {
hardware.form.server = true; hardware.form.server = true;
virtualization.enable = true;
}; };
boot.loader.timeout = 5; boot.loader.timeout = 5;
virtualisation.enable = true;
persist = { persist = {
directories = [ directories = [
"/srv" "/srv"

View file

@ -37,9 +37,10 @@
puzzles.enable = true; puzzles.enable = true;
}; };
}; };
virtualization.enable = true;
}; };
virtualisation.enable = true;
programs.ns-usbloader.enable = true; programs.ns-usbloader.enable = true;
hardware.uinput.enable = true; hardware.uinput.enable = true;
services.joycond.enable = true; services.joycond.enable = true;

View file

@ -2,22 +2,22 @@
with lib; with lib;
with lib.our; with lib.our;
let let
cfg = config.modules.virtualization; cfg = config.virtualisation;
in in
{ {
options.modules.virtualization = { options.virtualisation = {
enable = mkBoolOpt false; enable = mkBoolOpt false;
}; };
config = mkIf cfg.enable { config = {
virtualisation = { virtualisation = {
libvirtd.enable = true; libvirtd.enable = mkDefault cfg.enable;
docker.enable = true; docker.enable = mkDefault cfg.enable;
}; };
programs.dconf.enable = true;
environment.systemPackages = with pkgs; [ virt-manager docker-compose ]; programs.dconf.enable = mkIf cfg.libvirtd.enable true;
persist.directories = [ environment.systemPackages = (optional cfg.libvirtd.enable pkgs.virt-manager)
"/var/lib/libvirt" ++ (optional cfg.docker.enable pkgs.docker-compose);
]; persist.directories = optional cfg.libvirtd.enable "/var/lib/libvirt";
}; };
} }