From 2b231cdc9b0537f57be8260463d7e96fe22138ed Mon Sep 17 00:00:00 2001 From: awwpotato Date: Thu, 19 Jun 2025 12:51:33 -0700 Subject: [PATCH] treewide: use config in literalExpressions (#1517) Link: https://github.com/nix-community/stylix/pull/1517 Reviewed-by: Matt Sturgeon Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com> --- modules/hyprland/hm.nix | 2 +- modules/swaylock/hm.nix | 2 +- stylix/target.nix | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/hyprland/hm.nix b/modules/hyprland/hm.nix index 70ef1be2..a7c624ce 100644 --- a/modules/hyprland/hm.nix +++ b/modules/hyprland/hm.nix @@ -10,7 +10,7 @@ mkTarget { extraOptions.hyprpaper.enable = config.lib.stylix.mkEnableTargetWith { name = "Hyprpaper"; autoEnable = config.stylix.image != null; - autoEnableExpr = "stylix.image != null"; + autoEnableExpr = "config.stylix.image != null"; }; configElements = [ ( diff --git a/modules/swaylock/hm.nix b/modules/swaylock/hm.nix index 67570095..b0aa4f59 100644 --- a/modules/swaylock/hm.nix +++ b/modules/swaylock/hm.nix @@ -23,7 +23,7 @@ mkTarget { && pkgs.stdenv.hostPlatform.isLinux; autoEnableExpr = '' - lib.versionAtLeast home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux + lib.versionAtLeast config.home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux ''; extraOptions.useWallpaper = config.lib.stylix.mkEnableWallpaper "Swaylock" true; diff --git a/stylix/target.nix b/stylix/target.nix index 4ec78760..f8b6861b 100644 --- a/stylix/target.nix +++ b/stylix/target.nix @@ -95,9 +95,9 @@ default = cfg.autoEnable && autoEnable; defaultText = if args ? autoEnableExpr then - lib.literalExpression "stylix.autoEnable && ${wrapExpr autoEnableExpr}" + lib.literalExpression "config.stylix.autoEnable && ${wrapExpr autoEnableExpr}" else if autoEnable then - lib.literalExpression "stylix.autoEnable" + lib.literalExpression "config.stylix.autoEnable" else false; inherit example; @@ -109,7 +109,10 @@ description = "Whether to set the wallpaper for ${humanName}."; default = config.stylix.image != null && autoEnable; defaultText = - if autoEnable then lib.literalExpression "stylix.image != null" else false; + if autoEnable then + lib.literalExpression "config.stylix.image != null" + else + false; example = config.stylix.image == null; };