moved homelab virtualization config to apps modules

This commit is contained in:
Aly Raffauf 2024-03-29 21:51:10 -04:00
parent c0e6d57378
commit 51c74e2b1f
9 changed files with 46 additions and 30 deletions

View file

@ -23,7 +23,7 @@
fwupd.enable = true; fwupd.enable = true;
fprintd.package = pkgs.fprintd.overrideAttrs { fprintd.package = pkgs.fprintd.overrideAttrs {
mesonCheckFlags = [ "--no-suite" "fprintd:TestPamFprintd" ]; mesonCheckFlags = [ "--no-suite" "fprintd:TestPamFprintd" ];
}; };
}; };
systemConfig = { systemConfig = {
@ -38,12 +38,13 @@
apps = { apps = {
flatpak.enable = true; flatpak.enable = true;
podman.enable = true;
steam.enable = true; steam.enable = true;
virt-manager.enable = true;
}; };
homeLab.virtualization.enable = true; users.users.aly.hashedPassword =
"$y$j9T$O9NgTk6iRfh3mxiRDvfdm1$BjvsAKYEMB3C28652FF15cj/i.3TgQAObQvR0rN1E6C";
users.users.aly.hashedPassword = "$y$j9T$O9NgTk6iRfh3mxiRDvfdm1$BjvsAKYEMB3C28652FF15cj/i.3TgQAObQvR0rN1E6C";
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -81,15 +81,17 @@ in {
desktopEnvironments.gnome.enable = true; desktopEnvironments.gnome.enable = true;
}; };
apps = { systemConfig = {
flatpak.enable = true; plymouth.enable = true;
steam.enable = false; zramSwap.enable = true;
}; };
homeLab.virtualization.enable = true; apps = {
flatpak.enable = true;
systemConfig.plymouth.enable = true; podman.enable = true;
systemConfig.zramSwap.enable = true; steam.enable = true;
virt-manager.enable = true;
};
system.stateVersion = "23.11"; system.stateVersion = "23.11";
} }

View file

@ -17,6 +17,11 @@
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
systemConfig = {
plymouth.enable = true;
zramSwap.enable = true;
};
desktopConfig = { desktopConfig = {
enable = true; enable = true;
windowManagers.hyprland.enable = true; windowManagers.hyprland.enable = true;
@ -27,8 +32,5 @@
steam.enable = false; steam.enable = false;
}; };
systemConfig.plymouth.enable = true;
systemConfig.zramSwap.enable = true;
system.stateVersion = "23.11"; # Did you read the comment? system.stateVersion = "23.11"; # Did you read the comment?
} }

View file

@ -1,5 +1,5 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
imports = [ ./flatpak ./steam ]; imports = [ ./flatpak ./steam ./podman ./virt-manager ];
} }

View file

@ -1,15 +1,13 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
options = { options = {
homeLab.virtualization.enable = apps.podman.enable =
lib.mkEnableOption "Enables podman and virt-manager virtualization."; lib.mkEnableOption "Enables Podman for OCI container support.";
}; };
config = lib.mkIf config.homeLab.virtualization.enable { config = lib.mkIf config.apps.podman.enable {
programs.virt-manager.enable = true;
virtualisation = { virtualisation = {
libvirtd.enable = true;
oci-containers = { backend = "podman"; }; oci-containers = { backend = "podman"; };
podman = { podman = {
# Required for containers under podman-compose to be able to talk to each other. # Required for containers under podman-compose to be able to talk to each other.
@ -17,5 +15,6 @@
enable = true; enable = true;
}; };
}; };
}; };
} }

View file

@ -0,0 +1,15 @@
{ pkgs, lib, config, ... }: {
options = {
apps.virt-manager.enable =
lib.mkEnableOption "Enables virt-manager with TPM and EFI support.";
};
config = lib.mkIf config.apps.virt-manager.enable {
programs.virt-manager.enable = true;
virtualisation = { libvirtd.enable = true; };
};
}

View file

@ -1,16 +1,10 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
imports = [ imports =
./binaryCache [ ./binaryCache ./reverseProxy ./nixContainers ./ociContainers ./samba ];
./reverseProxy
./nixContainers
./ociContainers
./samba
./virtualization
];
options = { options = {
homeLab.enable = lib.mkEnableOption "Enables fully functional HomeLab."; homeLab.enable = lib.mkEnableOption "Enables fully functional Home Lab.";
}; };
config = lib.mkIf config.homeLab.enable { config = lib.mkIf config.homeLab.enable {
@ -19,6 +13,5 @@
homeLab.ociContainers.enable = lib.mkDefault true; homeLab.ociContainers.enable = lib.mkDefault true;
homeLab.reverseProxy.enable = lib.mkDefault true; homeLab.reverseProxy.enable = lib.mkDefault true;
homeLab.samba.enable = lib.mkDefault true; homeLab.samba.enable = lib.mkDefault true;
homeLab.virtualization.enable = lib.mkDefault true;
}; };
} }

View file

@ -6,6 +6,7 @@
}; };
config = lib.mkIf config.homeLab.nixContainers.enable { config = lib.mkIf config.homeLab.nixContainers.enable {
containers.navidrome = { containers.navidrome = {
autoStart = true; autoStart = true;
bindMounts."/Music".hostPath = "/mnt/Media/Music"; bindMounts."/Music".hostPath = "/mnt/Media/Music";

View file

@ -6,6 +6,9 @@
}; };
config = lib.mkIf config.homeLab.ociContainers.enable { config = lib.mkIf config.homeLab.ociContainers.enable {
apps.podman.enable = lib.mkDefault true;
virtualisation.oci-containers.containers = { virtualisation.oci-containers.containers = {
audiobookshelf = { audiobookshelf = {
ports = [ "0.0.0.0:13378:80" ]; ports = [ "0.0.0.0:13378:80" ];