fix(home-manager): correctly set btop's theme (#48)

This commit is contained in:
Anomalocaridid 2023-11-02 15:49:39 +00:00 committed by GitHub
parent 5713b478b1
commit 3a12806a37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
};
}