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

@ -38,12 +38,13 @@
apps = {
flatpak.enable = true;
podman.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?
}

View file

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

View file

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

View file

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

View file

@ -1,15 +1,13 @@
{ pkgs, lib, config, ... }: {
options = {
homeLab.virtualization.enable =
lib.mkEnableOption "Enables podman and virt-manager virtualization.";
apps.podman.enable =
lib.mkEnableOption "Enables Podman for OCI container support.";
};
config = lib.mkIf config.homeLab.virtualization.enable {
programs.virt-manager.enable = true;
config = lib.mkIf config.apps.podman.enable {
virtualisation = {
libvirtd.enable = true;
oci-containers = { backend = "podman"; };
podman = {
# Required for containers under podman-compose to be able to talk to each other.
@ -17,5 +15,6 @@
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, ... }: {
imports = [
./binaryCache
./reverseProxy
./nixContainers
./ociContainers
./samba
./virtualization
];
imports =
[ ./binaryCache ./reverseProxy ./nixContainers ./ociContainers ./samba ];
options = {
homeLab.enable = lib.mkEnableOption "Enables fully functional HomeLab.";
homeLab.enable = lib.mkEnableOption "Enables fully functional Home Lab.";
};
config = lib.mkIf config.homeLab.enable {
@ -19,6 +13,5 @@
homeLab.ociContainers.enable = lib.mkDefault true;
homeLab.reverseProxy.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 {
containers.navidrome = {
autoStart = true;
bindMounts."/Music".hostPath = "/mnt/Media/Music";

View file

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