From ea4c8d16ddcb5650d39977524efd6ef7df409e05 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 3 Apr 2024 02:42:30 -0400 Subject: [PATCH] specializations: Make opt-in with mkEnableOption Specializations basically double the build time for each one added, so requiring users to explicitly enable it means quicker build times for those that prefer Hyprland (which is easier to configure declaratively). --- modules/specializations.nix | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/specializations.nix b/modules/specializations.nix index 6e05305e..6c6f661c 100644 --- a/modules/specializations.nix +++ b/modules/specializations.nix @@ -1,11 +1,17 @@ -{ - specialisation = { - gnome.configuration.imports = [ - ../specializations/gnome.nix - ]; +{ config, lib, ... }: - plasma.configuration.imports = [ - ../specializations/plasma.nix - ]; +let + cfg = config.modules.specializations; +in +{ + options.modules.specializations = { + enable = lib.mkEnableOption "specializations"; + }; + + config = lib.mkIf cfg.enable { + specialisation = { + gnome.configuration.imports = [ ../specializations/gnome.nix ]; + plasma.configuration.imports = [ ../specializations/plasma.nix ]; + }; }; }