fix(home-manager): link GTK 4.0 files (#114)
* fix(home-manager): link GTK 4.0 files * fix(home-manager): add xdg assertion for gtk * fix(home-manager): fix gtk missing enable check for xdg assert * fix(home-manager): use string interpolation for gtk directory * fix(home-manager): fix formatting for gtk.nix
This commit is contained in:
parent
372decb578
commit
4b98726102
1 changed files with 43 additions and 27 deletions
|
@ -30,36 +30,52 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.gtk = lib.mkIf enable {
|
config = lib.mkIf enable {
|
||||||
theme =
|
assertions = [
|
||||||
let
|
(lib.ctp.assertXdgEnabled "gtk")
|
||||||
flavourUpper = ctp.mkUpper cfg.flavour;
|
];
|
||||||
accentUpper = ctp.mkUpper cfg.accent;
|
|
||||||
sizeUpper = ctp.mkUpper cfg.size;
|
|
||||||
|
|
||||||
# use the light gtk theme for latte
|
gtk = {
|
||||||
gtkTheme =
|
theme =
|
||||||
if cfg.flavour == "latte"
|
let
|
||||||
then "Light"
|
flavourUpper = ctp.mkUpper cfg.flavour;
|
||||||
else "Dark";
|
accentUpper = ctp.mkUpper cfg.accent;
|
||||||
|
sizeUpper = ctp.mkUpper cfg.size;
|
||||||
|
|
||||||
|
# use the light gtk theme for latte
|
||||||
|
gtkTheme =
|
||||||
|
if cfg.flavour == "latte"
|
||||||
|
then "Light"
|
||||||
|
else "Dark";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
|
||||||
|
package = pkgs.catppuccin-gtk.override {
|
||||||
|
inherit (cfg) size tweaks;
|
||||||
|
accents = [ cfg.accent ];
|
||||||
|
variant = cfg.flavour;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cursorTheme =
|
||||||
|
let
|
||||||
|
flavourUpper = ctp.mkUpper cfg.cursor.flavour;
|
||||||
|
accentUpper = ctp.mkUpper cfg.cursor.accent;
|
||||||
|
in
|
||||||
|
lib.mkIf cfg.cursor.enable {
|
||||||
|
name = "Catppuccin-${flavourUpper}-${accentUpper}-Cursors";
|
||||||
|
package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile =
|
||||||
|
let
|
||||||
|
gtk4Dir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
name = "Catppuccin-${flavourUpper}-${sizeUpper}-${accentUpper}-${gtkTheme}";
|
"gtk-4.0/assets".source = "${gtk4Dir}/assets";
|
||||||
package = pkgs.catppuccin-gtk.override {
|
"gtk-4.0/gtk.css".source = "${gtk4Dir}/gtk.css";
|
||||||
inherit (cfg) size tweaks;
|
"gtk-4.0/gtk-dark.css".source = "${gtk4Dir}/gtk-dark.css";
|
||||||
accents = [ cfg.accent ];
|
|
||||||
variant = cfg.flavour;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cursorTheme =
|
|
||||||
let
|
|
||||||
flavourUpper = ctp.mkUpper cfg.cursor.flavour;
|
|
||||||
accentUpper = ctp.mkUpper cfg.cursor.accent;
|
|
||||||
in
|
|
||||||
lib.mkIf cfg.cursor.enable {
|
|
||||||
name = "Catppuccin-${flavourUpper}-${accentUpper}-Cursors";
|
|
||||||
package = pkgs.catppuccin-cursors.${cfg.cursor.flavour + accentUpper};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue