fix(home-manager): dont declare xdg.configFile when btop isn't enabled (#37)
This commit is contained in:
parent
2558a75928
commit
9616836d65
1 changed files with 23 additions and 14 deletions
|
@ -1,25 +1,34 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config
|
||||||
|
, pkgs
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.programs.btop.catppuccin;
|
cfg = config.programs.btop.catppuccin;
|
||||||
themePath = "/themes/catppuccin_${cfg.flavour}.theme";
|
themePath = "/themes/catppuccin_${cfg.flavour}.theme";
|
||||||
theme = pkgs.fetchFromGitHub
|
theme =
|
||||||
{
|
pkgs.fetchFromGitHub
|
||||||
owner = "catppuccin";
|
{
|
||||||
repo = "btop";
|
owner = "catppuccin";
|
||||||
rev = "7109eac2884e9ca1dae431c0d7b8bc2a7ce54e54";
|
repo = "btop";
|
||||||
sha256 = "sha256-QoPPx4AzxJMYo/prqmWD/CM7e5vn/ueyx+XQ5+YfHF8=";
|
rev = "7109eac2884e9ca1dae431c0d7b8bc2a7ce54e54";
|
||||||
} + themePath;
|
sha256 = "sha256-QoPPx4AzxJMYo/prqmWD/CM7e5vn/ueyx+XQ5+YfHF8=";
|
||||||
|
}
|
||||||
|
+ themePath;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.btop.catppuccin =
|
options.programs.btop.catppuccin =
|
||||||
lib.ctp.mkCatppuccinOpt "btop" config;
|
lib.ctp.mkCatppuccinOpt "btop" config;
|
||||||
|
|
||||||
# xdg is required for this to work
|
# xdg is required for this to work
|
||||||
config.xdg.enable = with lib; mkIf cfg.enable (mkForce true);
|
config =
|
||||||
|
{
|
||||||
|
xdg.enable = with lib; mkIf cfg.enable (mkForce true);
|
||||||
|
|
||||||
config.xdg.configFile."btop${themePath}".source = with lib;
|
programs.btop.settings.color_theme = with lib;
|
||||||
mkIf cfg.enable theme;
|
mkIf cfg.enable "${config.xdg.configHome + "/btop/${themePath}"}";
|
||||||
|
}
|
||||||
config.programs.btop.settings.color_theme = with lib;
|
// (lib.mkIf cfg.enable {
|
||||||
mkIf cfg.enable "${config.xdg.configHome + "/btop/${themePath}"}";
|
xdg.configFile."btop${themePath}".source = theme;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue