Skip to content

Commit

Permalink
fix(home-manager/waybar): inline styleFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichthagel committed Apr 23, 2024
1 parent 29699c8 commit 0d1a53a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions modules/home-manager/waybar.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
{ config
, lib
, sources
, ...
{
config,
lib,
sources,
...
}:
let
cfg = config.programs.waybar.catppuccin;
enable = cfg.enable && config.programs.waybar.enable;
in
{
options.programs.waybar.catppuccin = (lib.ctp.mkCatppuccinOpt "waybar") // {
styleFile = lib.mkOption {
type = lib.types.path;
default = "${sources.waybar}/themes/${cfg.flavour}.css";
description = "Path to CSS file containing color variable definitions";
};

prependImport = lib.mkOption {
type = lib.types.bool;
default = false;
Expand All @@ -28,13 +23,18 @@ in
};
};

config = lib.mkIf enable {
programs.waybar.style = lib.mkIf cfg.prependImport (
lib.mkBefore ''
@import "${cfg.styleFile}";
''
);
config = lib.mkIf enable (
let
styleFile = "${sources.waybar}/themes/${cfg.flavour}.css";
in
{
programs.waybar.style = lib.mkIf cfg.prependImport (
lib.mkBefore ''
@import "${styleFile}";
''
);

xdg.configFile."waybar/catppuccin.css" = lib.mkIf cfg.createLink { source = cfg.styleFile; };
};
xdg.configFile."waybar/catppuccin.css" = lib.mkIf cfg.createLink { source = styleFile; };
}
);
}

0 comments on commit 0d1a53a

Please sign in to comment.