From 3a12806a377fd146a5784b3c004b5b06513b8fb5 Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:49:39 +0000 Subject: [PATCH] fix(home-manager): correctly set btop's theme (#48) --- modules/home-manager/btop.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/home-manager/btop.nix b/modules/home-manager/btop.nix index 889a7e60..4c2fc440 100644 --- a/modules/home-manager/btop.nix +++ b/modules/home-manager/btop.nix @@ -8,7 +8,8 @@ let cfg = config.programs.btop.catppuccin; enable = cfg.enable && config.programs.btop.enable; - themePath = "/themes/catppuccin_${cfg.flavour}.theme"; + themeFile = "catppuccin_${cfg.flavour}.theme"; + themePath = "/themes/${themeFile}"; theme = pkgs.fetchFromGitHub { @@ -23,15 +24,14 @@ in options.programs.btop.catppuccin = lib.ctp.mkCatppuccinOpt "btop" config; - # xdg is required for this to work - config = + config = mkIf enable { - xdg.enable = mkIf enable (lib.mkForce true); + xdg = { + # xdg is required for this to work + enable = lib.mkForce true; + configFile."btop${themePath}".source = theme; + }; - programs.btop.settings.color_theme = - mkIf enable "${config.xdg.configHome + "/btop/${themePath}"}"; - } - // (lib.mkIf enable { - xdg.configFile."btop${themePath}".source = theme; - }); + programs.btop.settings.color_theme = themeFile; + }; }