From 34076b9518c9b7df20a76289f92a93baae0c2e3d Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:57:52 +0530 Subject: [PATCH] Make virtualization optional --- configuration.nix | 75 ++++++++++--------- flake.nix | 1 + home.nix | 8 +- ...{virtualization.nix => virtualisation.nix} | 0 4 files changed, 46 insertions(+), 38 deletions(-) rename system/{virtualization.nix => virtualisation.nix} (100%) diff --git a/configuration.nix b/configuration.nix index 02d33ede..51545a86 100644 --- a/configuration.nix +++ b/configuration.nix @@ -6,43 +6,46 @@ { config, lib, pkgs, pkgs-stable, systemSettings, userSettings, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - # include boot and kernel settings - ./system/boot-kernel.nix - # include user account settings - ./system/users.nix - # include hardware settings - ./system/hardware/audio.nix - ./system/hardware/bluetooth.nix - ./system/hardware/disk.nix - ./system/hardware/graphics.nix - # include network settings - ./system/network.nix - # include locale settings - ./system/locale.nix - # include fonts settings - ./system/fonts.nix - # include hyprland settings - ./system/hyprland.nix - # include virtualization settings - #./system/virtualization.nix - # include printing settings - ./system/printing.nix - # include power plan settings - ./system/power.nix - - # include APPS settings - ./apps/openrgb.nix - #./apps/kde-connect.nix + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + # include boot and kernel settings + ./system/boot-kernel.nix + # include user account settings + ./system/users.nix + # include hardware settings + ./system/hardware/audio.nix + ./system/hardware/bluetooth.nix + ./system/hardware/disk.nix + ./system/hardware/graphics.nix + # include network settings + ./system/network.nix + # include locale settings + ./system/locale.nix + # include fonts settings + ./system/fonts.nix + # include hyprland settings + ./system/hyprland.nix + # include printing settings + ./system/printing.nix + # include power plan settings + ./system/power.nix + + # include APPS settings + ./apps/openrgb.nix + #./apps/kde-connect.nix - # include adb settings - ./dev-environment/adb.nix - - # include custom cache server settings - ./misc/custom-cache-server.nix - ]; + # include adb settings + ./dev-environment/adb.nix + + # include custom cache server settings + ./misc/custom-cache-server.nix + ] + ++ + # Import if Virtualization is enabled + lib.optionals (systemSettings.virtualisation) [ + ./system/virtualisation.nix + ]; networking.hostName = systemSettings.hostname; # Define your hostname. diff --git a/flake.nix b/flake.nix index e1ea28f8..9093d7b4 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ localeoverride = "en_IN"; stableversion = "24.05"; secureboot = true; + virtualisation = false; }; # ----- USER SETTINGS ----- # diff --git a/home.nix b/home.nix index c5f0f9e1..1b529003 100644 --- a/home.nix +++ b/home.nix @@ -1,4 +1,4 @@ -{ config, pkgs, pkgs-stable, systemSettings, userSettings, ... }: +{ config, lib, pkgs, pkgs-stable, systemSettings, userSettings, ... }: { # Home Manager needs a bit of information about you and the paths it should @@ -12,9 +12,13 @@ ./home-manager/alacritty/alacritty.nix ./home-manager/pyprland/pyprland.nix # pyprland config wrapper ./home-manager/neofetch/neofetch.nix - ./home-manager/virt-manager/virt-manager.nix ./home-manager/vscode/vscode.nix ./home-manager/thunar/thunar.nix + ] + ++ + # Import if Virtualization is enabled + lib.optionals (systemSettings.virtualisation) [ + ./home-manager/virt-manager/virt-manager.nix ]; # link the configuration file in current directory to the specified location in home directory diff --git a/system/virtualization.nix b/system/virtualisation.nix similarity index 100% rename from system/virtualization.nix rename to system/virtualisation.nix