Skip to content

Commit

Permalink
feat: move to catppuccin namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Nov 23, 2024
1 parent 32359bf commit 47c5208
Show file tree
Hide file tree
Showing 56 changed files with 944 additions and 155 deletions.
13 changes: 11 additions & 2 deletions modules/home-manager/aerc.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.aerc.catppuccin;
cfg = config.catppuccin.aerc;
enable = cfg.enable && config.programs.aerc.enable;
themeName = "catppuccin-${cfg.flavor}";
in
{
options.programs.aerc.catppuccin = lib.ctp.mkCatppuccinOpt { name = "aerc"; };
options.catppuccin.aerc = lib.ctp.mkCatppuccinOpt { name = "aerc"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"aerc"
"catppuccin"
];
to = "aerc";
};

config = lib.mkIf enable {
programs.aerc = {
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/alacritty.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.alacritty.catppuccin;
cfg = config.catppuccin.alacritty;
enable = cfg.enable && config.programs.alacritty.enable;
in
{
options.programs.alacritty.catppuccin = lib.ctp.mkCatppuccinOpt { name = "alacritty"; };
options.catppuccin.alacritty = lib.ctp.mkCatppuccinOpt { name = "alacritty"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"alacritty"
"catppuccin"
];
to = "alacritty";
};

config = lib.mkIf enable {
programs.alacritty.settings = lib.importTOML "${sources.alacritty}/catppuccin-${cfg.flavor}.toml";
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/bat.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.bat.catppuccin;
cfg = config.catppuccin.bat;
enable = cfg.enable && config.programs.bat.enable;
themeName = "Catppuccin ${lib.ctp.mkUpper cfg.flavor}";
in
{
options.programs.bat.catppuccin = lib.ctp.mkCatppuccinOpt { name = "bat"; };
options.catppuccin.bat = lib.ctp.mkCatppuccinOpt { name = "bat"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"bat"
"catppuccin"
];
to = "bat";
};

config = lib.mkIf enable {
programs.bat = {
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/bottom.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.bottom.catppuccin;
cfg = config.catppuccin.bottom;
enable = cfg.enable && config.programs.bottom.enable;
in
{
options.programs.bottom.catppuccin = lib.ctp.mkCatppuccinOpt { name = "bottom"; };
options.catppuccin.bottom = lib.ctp.mkCatppuccinOpt { name = "bottom"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"bottom"
"catppuccin"
];
to = "bottom";
};

config = lib.mkIf enable {
programs.bottom = {
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/btop.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.btop.catppuccin;
cfg = config.catppuccin.btop;
enable = cfg.enable && config.programs.btop.enable;

themeFile = "catppuccin_${cfg.flavor}.theme";
themePath = "/themes/${themeFile}";
theme = sources.btop + themePath;
in
{
options.programs.btop.catppuccin = lib.ctp.mkCatppuccinOpt { name = "btop"; };
options.catppuccin.btop = lib.ctp.mkCatppuccinOpt { name = "btop"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"btop"
"catppuccin"
];
to = "btop";
};

config = lib.mkIf enable {
xdg.configFile."btop${themePath}".source = theme;
Expand Down
29 changes: 27 additions & 2 deletions modules/home-manager/cava.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.cava.catppuccin;
cfg = config.catppuccin.cava;
enable = cfg.enable && config.programs.cava.enable;
flavor = "${cfg.flavor}" + lib.optionalString cfg.transparent "-transparent";
in
{
options.programs.cava.catppuccin = lib.ctp.mkCatppuccinOpt { name = "cava"; } // {
options.catppuccin.cava = lib.ctp.mkCatppuccinOpt { name = "cava"; } // {
transparent = lib.mkEnableOption "transparent version of flavor";
};

imports =
(lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"cava"
"catppuccin"
];
to = "cava";
})
++ [
(lib.mkRenamedOptionModule
[
"programs"
"cava"
"catppuccin"
"transparent"
]
[
"catppuccin"
"cava"
"transparent"
]
)
];

config.programs.cava = lib.mkIf enable {
settings = lib.ctp.fromINIRaw (sources.cava + "/themes/${flavor}.cava");
};
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/cursor.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}:
let
inherit (lib) ctp mkIf;
cfg = config.catppuccin.pointerCursor;
cfg = config.catppuccin.cursors;

# "dark" and "light" can be used alongside the regular accents
cursorAccentType = ctp.mergeEnums ctp.types.accentOption (
Expand All @@ -17,7 +17,7 @@ let
);
in
{
options.catppuccin.pointerCursor =
options.catppuccin.cursors =
ctp.mkCatppuccinOpt {
name = "pointer cursors";
# NOTE: we exclude this from the global `catppuccin.enable` as there is no
Expand All @@ -28,6 +28,15 @@ in
accent = ctp.mkBasicOpt "accent" cursorAccentType "cursors";
};

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"catppuccin"
"pointerCursor"
];
to = "cursors";
accentSupport = true;
};

config.home.pointerCursor = mkIf cfg.enable {
name = "catppuccin-${cfg.flavor}-${cfg.accent}-cursors";
package = pkgs.catppuccin-cursors.${cfg.flavor + ctp.mkUpper cfg.accent};
Expand Down
14 changes: 12 additions & 2 deletions modules/home-manager/delta.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.git.delta.catppuccin;
cfg = config.catppuccin.delta;
enable = cfg.enable && config.programs.git.delta.enable;
in
{
options.programs.git.delta.catppuccin = lib.ctp.mkCatppuccinOpt { name = "delta"; };
options.catppuccin.delta = lib.ctp.mkCatppuccinOpt { name = "delta"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"git"
"delta"
"catppuccin"
];
to = "delta";
};

config = lib.mkIf enable {
programs.git = {
Expand Down
29 changes: 27 additions & 2 deletions modules/home-manager/dunst.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.services.dunst.catppuccin;
cfg = config.catppuccin.dunst;
enable = cfg.enable && config.services.dunst.enable;
in
{
options.services.dunst.catppuccin = lib.ctp.mkCatppuccinOpt { name = "dunst"; } // {
options.catppuccin.dunst = lib.ctp.mkCatppuccinOpt { name = "dunst"; } // {
prefix = lib.mkOption {
type = lib.types.str;
default = "00";
description = "Prefix to use for the dunst drop-in file";
};
};

imports =
(lib.ctp.mkRenamedCatppuccinOpts {
from = [
"services"
"dunst"
"catppuccin"
];
to = "dunst";
})
++ [
(lib.mkRenamedOptionModule
[
"services"
"dunst"
"catppuccin"
"prefix"
]
[
"catppuccin"
"dunst"
"prefix"
]
)
];

# Dunst currently has no "include" functionality, but has "drop-ins"
# Unfortunately, this may cause inconvenience as it overrides ~/.config/dunst/dunstrc
# but it can be overridden by another drop-in.
Expand Down
32 changes: 30 additions & 2 deletions modules/home-manager/fcitx5.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.i18n.inputMethod.fcitx5.catppuccin;
cfg = config.catppuccin.fcitx5;
enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5";
in
{
options.i18n.inputMethod.fcitx5.catppuccin = lib.ctp.mkCatppuccinOpt { name = "Fcitx5"; } // {
options.catppuccin.fcitx5 = lib.ctp.mkCatppuccinOpt { name = "Fcitx5"; } // {
accent = lib.ctp.mkAccentOpt "Fcitx5";
apply = lib.mkOption {
type = lib.types.bool;
Expand All @@ -17,6 +17,34 @@ in
};
};

imports =
(lib.ctp.mkRenamedCatppuccinOpts {
from = [
"i18n"
"inputMethod"
"fcitx5"
"catppuccin"
];
to = "fcitx5";
accentSupport = true;
})
++ [
(lib.mkRenamedOptionModule
[
"i18n"
"inputMethod"
"fcitx5"
"catppuccin"
"apply"
]
[
"catppuccin"
"fcitx5"
"apply"
]
)
];

config = lib.mkIf enable {
xdg.dataFile."fcitx5/themes/catppuccin-${cfg.flavor}-${cfg.accent}" = {
source = "${sources.fcitx5}/src/catppuccin-${cfg.flavor}-${cfg.accent}";
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/fish.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.fish.catppuccin;
cfg = config.catppuccin.fish;
enable = cfg.enable && config.programs.fish.enable;

themeName = "Catppuccin ${lib.ctp.mkUpper cfg.flavor}";
themePath = "/themes/${themeName}.theme";
in
{
options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt { name = "fish"; };
options.catppuccin.fish = lib.ctp.mkCatppuccinOpt { name = "fish"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"fish"
"catppuccin"
];
to = "fish";
};

config = lib.mkIf enable {
xdg.configFile."fish${themePath}".source = "${sources.fish}${themePath}";
Expand Down
13 changes: 11 additions & 2 deletions modules/home-manager/foot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@
let
inherit (config.catppuccin) sources;

cfg = config.programs.foot.catppuccin;
cfg = config.catppuccin.foot;
enable = cfg.enable && config.programs.foot.enable;
in
{
options.programs.foot.catppuccin = lib.ctp.mkCatppuccinOpt { name = "foot"; };
options.catppuccin.foot = lib.ctp.mkCatppuccinOpt { name = "foot"; };

imports = lib.ctp.mkRenamedCatppuccinOpts {
from = [
"programs"
"foot"
"catppuccin"
];
to = "foot";
};

config.programs.foot = lib.mkIf enable {
settings.main.include = sources.foot + "/themes/catppuccin-${cfg.flavor}.ini";
Expand Down
Loading

0 comments on commit 47c5208

Please sign in to comment.