From 75e660b6a07af6fc4d1d7aeff6f2f5ddaefc52e5 Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Sat, 10 Jan 2026 21:05:39 +0100 Subject: [PATCH] stylix/mk-target: remove redundant unconditionalConfig argument Remove the redundant unconditionalConfig argument to simplify the interface, as it is a subset of the existing config argument: { mkTarget, ... }: mkTarget { - unconditionalConfig = + config = _: lib.mkIf complexCondition { home.packages = [ pkgs.hello ]; }; } --- stylix/mk-target.nix | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/stylix/mk-target.nix b/stylix/mk-target.nix index ecd1ab1f..2edf705d 100644 --- a/stylix/mk-target.nix +++ b/stylix/mk-target.nix @@ -19,11 +19,6 @@ ```nix { mkTarget, lib, ... }: mkTarget { - unconditionalConfig = - lib.mkIf complexCondition { - home.packages = [ pkgs.hello ]; - }; - config = [ { programs.«name».theme.name = "stylix"; } @@ -125,11 +120,6 @@ : The target name used to generate options in the `stylix.targets.${name}` namespace. - `unconditionalConfig` (Attribute set or function or path) - : This argument mirrors the `config` argument but intentionally lacks - automatic safeguarding and should only be used for complex configurations - where `config` is unsuitable. - # Environment The function is provided alongside module arguments in any modules imported @@ -143,12 +133,6 @@ # of modules: # # { -# unconditionalConfig = -# { lib, pkgs }: -# lib.mkIf complexCondition { -# home.packages = [ pkgs.hello ]; -# }; -# # config = [ # { programs.example.theme.name = "stylix"; } # @@ -182,7 +166,6 @@ in imports ? [ ], name ? name', options ? [ ], - unconditionalConfig ? { }, }@args: let mkTargetConfig = config; @@ -341,10 +324,7 @@ let config.lib.stylix.mkEnableTargetWith enableArgs; config = lib.mkIf (config.stylix.enable && cfg.enable) ( - lib.mkMerge ( - lib.singleton (callModule false unconditionalConfig) - ++ map (callModule true) normalizedConfig - ) + lib.mkMerge (map (callModule true) normalizedConfig) ); }; in