From 910dc0dc3e9792ca9fe143fed318b59ac7857f9c Mon Sep 17 00:00:00 2001 From: awwpotato Date: Wed, 21 May 2025 13:52:03 -0700 Subject: [PATCH] btop: use mkTarget --- modules/btop/hm.nix | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/modules/btop/hm.nix b/modules/btop/hm.nix index 902d6f78..7e804c0d 100644 --- a/modules/btop/hm.nix +++ b/modules/btop/hm.nix @@ -1,22 +1,27 @@ -{ config, lib, ... }: { - options.stylix.targets.btop.enable = - config.lib.stylix.mkEnableTarget "btop" true; + mkTarget, + lib, + ... +}: +mkTarget { + name = "btop"; + humanName = "btop"; - config = - lib.mkIf - ( - config.stylix.enable - && config.stylix.targets.btop.enable - && config.programs.btop.enable - ) + configElements = [ + ( + { opacity }: + { + programs.btop.settings.theme_background = lib.mkIf ( + opacity.terminal != 1.0 + ) false; + } + ) + ( + { colors }: { programs.btop = { - settings = { - color_theme = "stylix"; - theme_background = lib.mkIf (config.stylix.opacity.terminal != 1.0) false; - }; - themes.stylix = with config.lib.stylix.colors.withHashtag; '' + settings.color_theme = "stylix"; + themes.stylix = with colors.withHashtag; '' #Generated by Stylix theme[main_bg]="${base00}" theme[main_fg]="${base05}" @@ -62,5 +67,7 @@ theme[process_end]="${base08}" ''; }; - }; + } + ) + ]; }