From 3f4607481bf3aa5cbb0bc67da456f8224391beba Mon Sep 17 00:00:00 2001 From: seth Date: Fri, 28 Jun 2024 16:29:30 +0000 Subject: [PATCH] chore(modules): use attrset as argument to `mkCatppuccinOpt` (#252) --- modules/home-manager/alacritty.nix | 2 +- modules/home-manager/bat.nix | 2 +- modules/home-manager/bottom.nix | 2 +- modules/home-manager/btop.nix | 2 +- modules/home-manager/cava.nix | 2 +- modules/home-manager/cursor.nix | 2 +- modules/home-manager/delta.nix | 2 +- modules/home-manager/dunst.nix | 2 +- modules/home-manager/fcitx5.nix | 2 +- modules/home-manager/fish.nix | 2 +- modules/home-manager/foot.nix | 2 +- modules/home-manager/fzf.nix | 2 +- modules/home-manager/gh-dash.nix | 2 +- modules/home-manager/gitui.nix | 2 +- modules/home-manager/glamour.nix | 2 +- modules/home-manager/gtk.nix | 6 ++--- modules/home-manager/helix.nix | 2 +- modules/home-manager/hyprland.nix | 8 ++++--- modules/home-manager/imv.nix | 2 +- modules/home-manager/k9s.nix | 2 +- modules/home-manager/kitty.nix | 2 +- modules/home-manager/kvantum.nix | 2 +- modules/home-manager/lazygit.nix | 2 +- modules/home-manager/mako.nix | 2 +- modules/home-manager/micro.nix | 2 +- modules/home-manager/mpv.nix | 2 +- modules/home-manager/neovim.nix | 2 +- modules/home-manager/newsboat.nix | 2 +- modules/home-manager/polybar.nix | 2 +- modules/home-manager/rio.nix | 2 +- modules/home-manager/rofi.nix | 2 +- modules/home-manager/skim.nix | 2 +- modules/home-manager/starship.nix | 2 +- modules/home-manager/sway.nix | 2 +- modules/home-manager/tmux.nix | 2 +- modules/home-manager/tofi.nix | 2 +- modules/home-manager/waybar.nix | 2 +- modules/home-manager/yazi.nix | 2 +- modules/home-manager/zathura.nix | 2 +- modules/home-manager/zellij.nix | 2 +- .../home-manager/zsh-syntax-highlighting.nix | 4 +++- modules/lib/default.nix | 23 ++++++++++++------- modules/nixos/console.nix | 2 +- modules/nixos/grub.nix | 2 +- modules/nixos/plymouth.nix | 2 +- modules/nixos/sddm.nix | 2 +- 46 files changed, 68 insertions(+), 57 deletions(-) diff --git a/modules/home-manager/alacritty.nix b/modules/home-manager/alacritty.nix index 131af5d..5e019f3 100644 --- a/modules/home-manager/alacritty.nix +++ b/modules/home-manager/alacritty.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.alacritty.enable; in { - options.programs.alacritty.catppuccin = lib.ctp.mkCatppuccinOpt "alacritty"; + options.programs.alacritty.catppuccin = lib.ctp.mkCatppuccinOpt { name = "alacritty"; }; config = lib.mkIf enable { programs.alacritty.settings = lib.importTOML "${sources.alacritty}/catppuccin-${cfg.flavor}.toml"; diff --git a/modules/home-manager/bat.nix b/modules/home-manager/bat.nix index 1ceee16..d8b4259 100644 --- a/modules/home-manager/bat.nix +++ b/modules/home-manager/bat.nix @@ -6,7 +6,7 @@ let themeName = "Catppuccin ${lib.ctp.mkUpper cfg.flavor}"; in { - options.programs.bat.catppuccin = lib.ctp.mkCatppuccinOpt "bat"; + options.programs.bat.catppuccin = lib.ctp.mkCatppuccinOpt { name = "bat"; }; config = lib.mkIf enable { programs.bat = { diff --git a/modules/home-manager/bottom.nix b/modules/home-manager/bottom.nix index 302f34f..69ba2fa 100644 --- a/modules/home-manager/bottom.nix +++ b/modules/home-manager/bottom.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.bottom.enable; in { - options.programs.bottom.catppuccin = lib.ctp.mkCatppuccinOpt "bottom"; + options.programs.bottom.catppuccin = lib.ctp.mkCatppuccinOpt { name = "bottom"; }; config = lib.mkIf enable { programs.bottom = { diff --git a/modules/home-manager/btop.nix b/modules/home-manager/btop.nix index a23a5f6..d14a844 100644 --- a/modules/home-manager/btop.nix +++ b/modules/home-manager/btop.nix @@ -9,7 +9,7 @@ let theme = sources.btop + themePath; in { - options.programs.btop.catppuccin = lib.ctp.mkCatppuccinOpt "btop"; + options.programs.btop.catppuccin = lib.ctp.mkCatppuccinOpt { name = "btop"; }; config = lib.mkIf enable { xdg.configFile."btop${themePath}".source = theme; diff --git a/modules/home-manager/cava.nix b/modules/home-manager/cava.nix index 5b613f9..80d63fe 100644 --- a/modules/home-manager/cava.nix +++ b/modules/home-manager/cava.nix @@ -6,7 +6,7 @@ let flavor = "${cfg.flavor}" + lib.optionalString cfg.transparent "-transparent"; in { - options.programs.cava.catppuccin = lib.ctp.mkCatppuccinOpt "cava" // { + options.programs.cava.catppuccin = lib.ctp.mkCatppuccinOpt { name = "cava"; } // { transparent = lib.mkEnableOption "transparent version of flavor"; }; diff --git a/modules/home-manager/cursor.nix b/modules/home-manager/cursor.nix index 44fbee2..398e3f6 100644 --- a/modules/home-manager/cursor.nix +++ b/modules/home-manager/cursor.nix @@ -17,7 +17,7 @@ let ); in { - options.catppuccin.pointerCursor = ctp.mkCatppuccinOpt "cursors" // { + options.catppuccin.pointerCursor = ctp.mkCatppuccinOpt { name = "pointer cursors"; } // { accent = ctp.mkBasicOpt "accent" cursorAccentType "cursors"; }; diff --git a/modules/home-manager/delta.nix b/modules/home-manager/delta.nix index 7c2a44c..72c814d 100644 --- a/modules/home-manager/delta.nix +++ b/modules/home-manager/delta.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.git.delta.enable; in { - options.programs.git.delta.catppuccin = lib.ctp.mkCatppuccinOpt "catppuccin"; + options.programs.git.delta.catppuccin = lib.ctp.mkCatppuccinOpt { name = "delta"; }; config = lib.mkIf enable { programs.git = { diff --git a/modules/home-manager/dunst.nix b/modules/home-manager/dunst.nix index af4eed8..e76e454 100644 --- a/modules/home-manager/dunst.nix +++ b/modules/home-manager/dunst.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.services.dunst.enable; in { - options.services.dunst.catppuccin = lib.ctp.mkCatppuccinOpt "dunst"; + options.services.dunst.catppuccin = lib.ctp.mkCatppuccinOpt { name = "dunst"; }; config.services.dunst = lib.mkIf enable { settings = lib.ctp.fromINI (sources.dunst + "/themes/${cfg.flavor}.conf"); diff --git a/modules/home-manager/fcitx5.nix b/modules/home-manager/fcitx5.nix index 15d4845..e094700 100644 --- a/modules/home-manager/fcitx5.nix +++ b/modules/home-manager/fcitx5.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.i18n.inputMethod.enabled == "fcitx5"; in { - options.i18n.inputMethod.fcitx5.catppuccin = lib.ctp.mkCatppuccinOpt "Fcitx5" // { + options.i18n.inputMethod.fcitx5.catppuccin = lib.ctp.mkCatppuccinOpt { name = "Fcitx5"; } // { apply = lib.mkOption { type = lib.types.bool; default = true; diff --git a/modules/home-manager/fish.nix b/modules/home-manager/fish.nix index dd4a431..e32ee3d 100644 --- a/modules/home-manager/fish.nix +++ b/modules/home-manager/fish.nix @@ -8,7 +8,7 @@ let themePath = "/themes/${themeName}.theme"; in { - options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt "fish"; + options.programs.fish.catppuccin = lib.ctp.mkCatppuccinOpt { name = "fish"; }; config = lib.mkIf enable { xdg.configFile."fish${themePath}".source = "${sources.fish}${themePath}"; diff --git a/modules/home-manager/foot.nix b/modules/home-manager/foot.nix index 3db25d1..2d9bd4d 100644 --- a/modules/home-manager/foot.nix +++ b/modules/home-manager/foot.nix @@ -7,7 +7,7 @@ let theme = lib.ctp.fromINI (sources.foot + "/themes/catppuccin-${cfg.flavor}.ini"); in { - options.programs.foot.catppuccin = lib.ctp.mkCatppuccinOpt "foot"; + options.programs.foot.catppuccin = lib.ctp.mkCatppuccinOpt { name = "foot"; }; config.programs.foot = lib.mkIf enable { settings = theme; }; } diff --git a/modules/home-manager/fzf.nix b/modules/home-manager/fzf.nix index 4761efb..fe58c68 100644 --- a/modules/home-manager/fzf.nix +++ b/modules/home-manager/fzf.nix @@ -7,7 +7,7 @@ let palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavor}.colors; in { - options.programs.fzf.catppuccin = lib.ctp.mkCatppuccinOpt "fzf"; + options.programs.fzf.catppuccin = lib.ctp.mkCatppuccinOpt { name = "fzf"; }; config.programs.fzf.colors = lib.mkIf enable diff --git a/modules/home-manager/gh-dash.nix b/modules/home-manager/gh-dash.nix index 5bdd6cf..85118ad 100644 --- a/modules/home-manager/gh-dash.nix +++ b/modules/home-manager/gh-dash.nix @@ -6,7 +6,7 @@ let theme = "${sources.gh-dash}/themes/${cfg.flavor}/catppuccin-${cfg.flavor}-${cfg.accent}.yml"; in { - options.programs.gh-dash.catppuccin = lib.ctp.mkCatppuccinOpt "gh-dash" // { + options.programs.gh-dash.catppuccin = lib.ctp.mkCatppuccinOpt { name = "gh-dash"; } // { accent = lib.ctp.mkAccentOpt "gh-dash"; }; diff --git a/modules/home-manager/gitui.nix b/modules/home-manager/gitui.nix index 6d095da..43b4def 100644 --- a/modules/home-manager/gitui.nix +++ b/modules/home-manager/gitui.nix @@ -6,7 +6,7 @@ let enable = cfg.enable && config.programs.gitui.enable; in { - options.programs.gitui.catppuccin = lib.ctp.mkCatppuccinOpt "gitui"; + options.programs.gitui.catppuccin = lib.ctp.mkCatppuccinOpt { name = "gitui"; }; config = lib.mkIf enable { programs.gitui.theme = builtins.path { diff --git a/modules/home-manager/glamour.nix b/modules/home-manager/glamour.nix index 73180f3..5b9e4d2 100644 --- a/modules/home-manager/glamour.nix +++ b/modules/home-manager/glamour.nix @@ -5,7 +5,7 @@ let inherit (cfg) enable; in { - options.programs.glamour.catppuccin = lib.ctp.mkCatppuccinOpt "glamour"; + options.programs.glamour.catppuccin = lib.ctp.mkCatppuccinOpt { name = "glamour"; }; config = { home.sessionVariables = lib.mkIf enable { diff --git a/modules/home-manager/gtk.nix b/modules/home-manager/gtk.nix index 6a3986e..39ce902 100644 --- a/modules/home-manager/gtk.nix +++ b/modules/home-manager/gtk.nix @@ -19,7 +19,7 @@ let enable = cfg.enable && config.gtk.enable; in { - options.gtk.catppuccin = ctp.mkCatppuccinOpt "gtk" // { + options.gtk.catppuccin = ctp.mkCatppuccinOpt { name = "gtk"; } // { # NOTE: we are overriding the previous declaration of `enable` here # as this module is deprecated and we do not want it to apply with # the global `catppuccin.enable` @@ -48,8 +48,8 @@ in gnomeShellTheme = mkEnableOption "Catppuccin gtk theme for GNOME Shell"; - icon = ctp.mkCatppuccinOpt "gtk modified Papirus icon theme" // { - accent = ctp.mkAccentOpt "gtk modified Papirus icon theme"; + icon = ctp.mkCatppuccinOpt { name = "GTK modified Papirus icon theme"; } // { + accent = ctp.mkAccentOpt "GTK modified Papirus icon theme"; }; }; diff --git a/modules/home-manager/helix.nix b/modules/home-manager/helix.nix index 67b6920..4b3b55c 100644 --- a/modules/home-manager/helix.nix +++ b/modules/home-manager/helix.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.helix.enable; in { - options.programs.helix.catppuccin = lib.ctp.mkCatppuccinOpt "helix" // { + options.programs.helix.catppuccin = lib.ctp.mkCatppuccinOpt { name = "helix"; } // { useItalics = lib.mkEnableOption "Italics in Catppuccin theme for Helix"; }; diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index b35f0ae..da82d9e 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -6,9 +6,11 @@ let inherit (config.catppuccin) pointerCursor; in { - options.wayland.windowManager.hyprland.catppuccin = lib.ctp.mkCatppuccinOpt "hyprland" // { - accent = lib.ctp.mkAccentOpt "hyprland"; - }; + options.wayland.windowManager.hyprland.catppuccin = + lib.ctp.mkCatppuccinOpt { name = "hyprland"; } + // { + accent = lib.ctp.mkAccentOpt "hyprland"; + }; config = lib.mkIf enable { home.sessionVariables = lib.mkIf pointerCursor.enable { diff --git a/modules/home-manager/imv.nix b/modules/home-manager/imv.nix index 4bc7a16..515b954 100644 --- a/modules/home-manager/imv.nix +++ b/modules/home-manager/imv.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.imv.enable; in { - options.programs.imv.catppuccin = lib.ctp.mkCatppuccinOpt "imv"; + options.programs.imv.catppuccin = lib.ctp.mkCatppuccinOpt { name = "imv"; }; config.programs.imv.settings = lib.mkIf enable ( lib.ctp.fromINI (sources.imv + "/themes/${cfg.flavor}.config") diff --git a/modules/home-manager/k9s.nix b/modules/home-manager/k9s.nix index 1331f14..cdfdcde 100644 --- a/modules/home-manager/k9s.nix +++ b/modules/home-manager/k9s.nix @@ -11,7 +11,7 @@ let theme = sources.k9s + "/dist/${themeFile}"; in { - options.programs.k9s.catppuccin = lib.ctp.mkCatppuccinOpt "k9s" // { + options.programs.k9s.catppuccin = lib.ctp.mkCatppuccinOpt { name = "k9s"; } // { transparent = lib.mkEnableOption "transparent version of flavor"; }; diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix index a5ea5eb..cd0adaf 100644 --- a/modules/home-manager/kitty.nix +++ b/modules/home-manager/kitty.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.kitty.enable; in { - options.programs.kitty.catppuccin = ctp.mkCatppuccinOpt "kitty"; + options.programs.kitty.catppuccin = ctp.mkCatppuccinOpt { name = "kitty"; }; config.programs.kitty = lib.mkIf enable { theme = "Catppuccin-${ctp.mkUpper cfg.flavor}"; }; } diff --git a/modules/home-manager/kvantum.nix b/modules/home-manager/kvantum.nix index b73c0c6..2f7d71a 100644 --- a/modules/home-manager/kvantum.nix +++ b/modules/home-manager/kvantum.nix @@ -17,7 +17,7 @@ let themeName = "Catppuccin-${flavorCapitalized}-${accentCapitalized}"; in { - options.qt.style.catppuccin = lib.ctp.mkCatppuccinOpt "Kvantum" // { + options.qt.style.catppuccin = lib.ctp.mkCatppuccinOpt { name = "Kvantum"; } // { accent = lib.ctp.mkAccentOpt "Kvantum"; apply = lib.mkOption { diff --git a/modules/home-manager/lazygit.nix b/modules/home-manager/lazygit.nix index 7653099..8e1a00d 100644 --- a/modules/home-manager/lazygit.nix +++ b/modules/home-manager/lazygit.nix @@ -8,7 +8,7 @@ let themePath = "${cfg.flavor}/${cfg.accent}.yml"; in { - options.programs.lazygit.catppuccin = lib.ctp.mkCatppuccinOpt "lazygit" // { + options.programs.lazygit.catppuccin = lib.ctp.mkCatppuccinOpt { name = "lazygit"; } // { accent = ctp.mkAccentOpt "lazygit"; }; diff --git a/modules/home-manager/mako.nix b/modules/home-manager/mako.nix index c7d9852..297f08a 100644 --- a/modules/home-manager/mako.nix +++ b/modules/home-manager/mako.nix @@ -14,7 +14,7 @@ let extraConfigAttrs = lib.attrsets.getAttrs [ "urgency=high" ] theme; in { - options.services.mako.catppuccin = lib.ctp.mkCatppuccinOpt "mako"; + options.services.mako.catppuccin = lib.ctp.mkCatppuccinOpt { name = "mako"; }; # Will cause infinite recursion if config.services.mako is directly set as a whole config.services.mako = lib.mkIf enable { diff --git a/modules/home-manager/micro.nix b/modules/home-manager/micro.nix index 59fc0d3..3db7da6 100644 --- a/modules/home-manager/micro.nix +++ b/modules/home-manager/micro.nix @@ -7,7 +7,7 @@ let themePath = "catppuccin-${cfg.flavor}.micro"; in { - options.programs.micro.catppuccin = lib.ctp.mkCatppuccinOpt "micro"; + options.programs.micro.catppuccin = lib.ctp.mkCatppuccinOpt { name = "micro"; }; config = lib.mkIf enable { programs.micro.settings.colorscheme = lib.removeSuffix ".micro" themePath; diff --git a/modules/home-manager/mpv.nix b/modules/home-manager/mpv.nix index 5f6b760..e56bf29 100644 --- a/modules/home-manager/mpv.nix +++ b/modules/home-manager/mpv.nix @@ -6,7 +6,7 @@ let themeDir = sources.mpv + "/themes/${cfg.flavor}/${cfg.accent}"; in { - options.programs.mpv.catppuccin = lib.ctp.mkCatppuccinOpt "mpv" // { + options.programs.mpv.catppuccin = lib.ctp.mkCatppuccinOpt { name = "mpv"; } // { accent = lib.ctp.mkAccentOpt "mpv"; }; diff --git a/modules/home-manager/neovim.nix b/modules/home-manager/neovim.nix index 9faa858..f8adfbf 100644 --- a/modules/home-manager/neovim.nix +++ b/modules/home-manager/neovim.nix @@ -9,7 +9,7 @@ let enable = cfg.enable && config.programs.neovim.enable; in { - options.programs.neovim.catppuccin = lib.ctp.mkCatppuccinOpt "neovim"; + options.programs.neovim.catppuccin = lib.ctp.mkCatppuccinOpt { name = "neovim"; }; config.programs.neovim = lib.mkIf enable { plugins = with pkgs.vimPlugins; [ diff --git a/modules/home-manager/newsboat.nix b/modules/home-manager/newsboat.nix index 0d1ca11..e3e79a4 100644 --- a/modules/home-manager/newsboat.nix +++ b/modules/home-manager/newsboat.nix @@ -7,7 +7,7 @@ let theme = if cfg.flavor == "latte" then "latte" else "dark"; in { - options.programs.newsboat.catppuccin = lib.ctp.mkCatppuccinOpt "newsboat"; + options.programs.newsboat.catppuccin = lib.ctp.mkCatppuccinOpt { name = "newsboat"; }; config = lib.mkIf enable { programs.newsboat.extraConfig = builtins.readFile "${sources.newsboat}/themes/${theme}"; diff --git a/modules/home-manager/polybar.nix b/modules/home-manager/polybar.nix index 4f61a19..3a6636b 100644 --- a/modules/home-manager/polybar.nix +++ b/modules/home-manager/polybar.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.services.polybar.enable; in { - options.services.polybar.catppuccin = lib.ctp.mkCatppuccinOpt "polybar"; + options.services.polybar.catppuccin = lib.ctp.mkCatppuccinOpt { name = "polybar"; }; config.services.polybar.extraConfig = lib.mkIf enable ( builtins.readFile "${sources.polybar}/themes/${cfg.flavor}.ini" diff --git a/modules/home-manager/rio.nix b/modules/home-manager/rio.nix index 5d254af..dd01829 100644 --- a/modules/home-manager/rio.nix +++ b/modules/home-manager/rio.nix @@ -7,7 +7,7 @@ let enable = cfg.enable && config.programs.rio.enable; in { - options.programs.rio.catppuccin = ctp.mkCatppuccinOpt "rio"; + options.programs.rio.catppuccin = ctp.mkCatppuccinOpt { name = "rio"; }; config = lib.mkIf enable { programs.rio.settings = lib.importTOML "${sources.rio}/themes/catppuccin-${cfg.flavor}.toml"; diff --git a/modules/home-manager/rofi.nix b/modules/home-manager/rofi.nix index 6e9276e..7fa6cad 100644 --- a/modules/home-manager/rofi.nix +++ b/modules/home-manager/rofi.nix @@ -6,7 +6,7 @@ let enable = cfg.enable && config.programs.rofi.enable; in { - options.programs.rofi.catppuccin = lib.ctp.mkCatppuccinOpt "rofi"; + options.programs.rofi.catppuccin = lib.ctp.mkCatppuccinOpt { name = "rofi"; }; config.programs.rofi = lib.mkIf enable { theme = { diff --git a/modules/home-manager/skim.nix b/modules/home-manager/skim.nix index 450be58..9eda30f 100644 --- a/modules/home-manager/skim.nix +++ b/modules/home-manager/skim.nix @@ -6,7 +6,7 @@ let palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavor}.colors; in { - options.programs.skim.catppuccin = lib.ctp.mkCatppuccinOpt "skim"; + options.programs.skim.catppuccin = lib.ctp.mkCatppuccinOpt { name = "skim"; }; config.programs.skim = lib.mkIf enable { defaultOptions = [ diff --git a/modules/home-manager/starship.nix b/modules/home-manager/starship.nix index 5e2514d..7007e91 100644 --- a/modules/home-manager/starship.nix +++ b/modules/home-manager/starship.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.starship.enable; in { - options.programs.starship.catppuccin = lib.ctp.mkCatppuccinOpt "starship"; + options.programs.starship.catppuccin = lib.ctp.mkCatppuccinOpt { name = "starship"; }; config.programs.starship.settings = lib.mkIf enable ( { diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index 414d396..d392f8a 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -6,7 +6,7 @@ let theme = "${sources.sway}/themes/catppuccin-${cfg.flavor}"; in { - options.wayland.windowManager.sway.catppuccin = lib.ctp.mkCatppuccinOpt "sway"; + options.wayland.windowManager.sway.catppuccin = lib.ctp.mkCatppuccinOpt { name = "sway"; }; config = lib.mkIf enable { wayland.windowManager.sway.extraConfigEarly = '' diff --git a/modules/home-manager/tmux.nix b/modules/home-manager/tmux.nix index e1928f0..69aa81c 100644 --- a/modules/home-manager/tmux.nix +++ b/modules/home-manager/tmux.nix @@ -24,7 +24,7 @@ let }; in { - options.programs.tmux.catppuccin = ctp.mkCatppuccinOpt "tmux" // { + options.programs.tmux.catppuccin = ctp.mkCatppuccinOpt { name = "tmux"; } // { extraConfig = mkOption { type = types.lines; description = "Additional configuration for the catppuccin plugin."; diff --git a/modules/home-manager/tofi.nix b/modules/home-manager/tofi.nix index b555f8e..6972f19 100644 --- a/modules/home-manager/tofi.nix +++ b/modules/home-manager/tofi.nix @@ -5,7 +5,7 @@ let enable = cfg.enable && config.programs.tofi.enable; in { - options.programs.tofi.catppuccin = lib.ctp.mkCatppuccinOpt "tofi"; + options.programs.tofi.catppuccin = lib.ctp.mkCatppuccinOpt { name = "tofi"; }; config.programs.tofi = lib.mkIf enable { settings = lib.ctp.fromINI (sources.tofi + "/themes/catppuccin-${cfg.flavor}"); diff --git a/modules/home-manager/waybar.nix b/modules/home-manager/waybar.nix index 6089d1b..df54cbb 100644 --- a/modules/home-manager/waybar.nix +++ b/modules/home-manager/waybar.nix @@ -6,7 +6,7 @@ let styleFile = "${sources.waybar}/themes/${cfg.flavor}.css"; in { - options.programs.waybar.catppuccin = (lib.ctp.mkCatppuccinOpt "waybar") // { + options.programs.waybar.catppuccin = lib.ctp.mkCatppuccinOpt { name = "waybar"; } // { mode = lib.mkOption { type = lib.types.enum [ "prependImport" diff --git a/modules/home-manager/yazi.nix b/modules/home-manager/yazi.nix index e405ee6..87bdeff 100644 --- a/modules/home-manager/yazi.nix +++ b/modules/home-manager/yazi.nix @@ -6,7 +6,7 @@ let enable = cfg.enable && config.programs.yazi.enable; in { - options.programs.yazi.catppuccin = lib.ctp.mkCatppuccinOpt "yazi"; + options.programs.yazi.catppuccin = lib.ctp.mkCatppuccinOpt { name = "yazi"; }; config = lib.mkIf enable { programs.yazi.theme = lib.importTOML "${sources.yazi}/themes/${cfg.flavor}.toml"; diff --git a/modules/home-manager/zathura.nix b/modules/home-manager/zathura.nix index ba65655..d009336 100644 --- a/modules/home-manager/zathura.nix +++ b/modules/home-manager/zathura.nix @@ -11,7 +11,7 @@ let themeFile = sources.zathura + "/src/catppuccin-${cfg.flavor}"; in { - options.programs.zathura.catppuccin = lib.ctp.mkCatppuccinOpt "zathura"; + options.programs.zathura.catppuccin = lib.ctp.mkCatppuccinOpt { name = "zathura"; }; config.programs.zathura.options = lib.mkIf enable ( lib.ctp.fromINI ( diff --git a/modules/home-manager/zellij.nix b/modules/home-manager/zellij.nix index 9592882..7d2e5d2 100644 --- a/modules/home-manager/zellij.nix +++ b/modules/home-manager/zellij.nix @@ -5,7 +5,7 @@ let themeName = "catppuccin-${cfg.flavor}"; in { - options.programs.zellij.catppuccin = lib.ctp.mkCatppuccinOpt "zellij"; + options.programs.zellij.catppuccin = lib.ctp.mkCatppuccinOpt { name = "zellij"; }; config = lib.mkIf enable { programs.zellij.settings = { diff --git a/modules/home-manager/zsh-syntax-highlighting.nix b/modules/home-manager/zsh-syntax-highlighting.nix index 59b886c..3269d03 100644 --- a/modules/home-manager/zsh-syntax-highlighting.nix +++ b/modules/home-manager/zsh-syntax-highlighting.nix @@ -6,7 +6,9 @@ let enable = cfg.enable && config.programs.zsh.syntaxHighlighting.enable; in { - options.programs.zsh.syntaxHighlighting.catppuccin = ctp.mkCatppuccinOpt "zsh syntax highlighting"; + options.programs.zsh.syntaxHighlighting.catppuccin = ctp.mkCatppuccinOpt { + name = "Zsh Syntax Highlighting"; + }; config.programs.zsh = lib.mkIf enable { initExtra = lib.mkBefore '' diff --git a/modules/lib/default.nix b/modules/lib/default.nix index 6012eaa..ec44674 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -107,15 +107,22 @@ in # string -> a # this creates a basic attrset only containing an - # enable and flavor option. the fist string should - # be the name of the module, followed by the local config - # attrset - mkCatppuccinOpt = name: { - enable = lib.mkEnableOption "Catppuccin theme" // { - default = config.catppuccin.enable; + # enable and flavor option. `name` should be the name + # of the module, while `enableDefault` is a boolean + # representing the default of the created `enable` + # option + mkCatppuccinOpt = + { + name, + enableDefault ? config.catppuccin.enable, + }: + { + enable = lib.mkEnableOption "Catppuccin theme for ${name}" // { + default = enableDefault; + }; + + flavor = ctp.mkFlavorOpt name; }; - flavor = ctp.mkFlavorOpt name; - }; # string -> a # this creates an accent option for modules diff --git a/modules/nixos/console.nix b/modules/nixos/console.nix index 38d1293..48844ba 100644 --- a/modules/nixos/console.nix +++ b/modules/nixos/console.nix @@ -6,7 +6,7 @@ let palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavor}.colors; in { - options.console.catppuccin = lib.ctp.mkCatppuccinOpt "console"; + options.console.catppuccin = lib.ctp.mkCatppuccinOpt { name = "console"; }; config.console.colors = lib.mkIf enable ( # Manually populate with colors from catppuccin/tty diff --git a/modules/nixos/grub.nix b/modules/nixos/grub.nix index 0b28efe..8458d8f 100644 --- a/modules/nixos/grub.nix +++ b/modules/nixos/grub.nix @@ -16,7 +16,7 @@ let ''; in { - options.boot.loader.grub.catppuccin = lib.ctp.mkCatppuccinOpt "grub"; + options.boot.loader.grub.catppuccin = lib.ctp.mkCatppuccinOpt { name = "grub"; }; config.boot.loader.grub = lib.mkIf enable { font = "${theme}/font.pf2"; diff --git a/modules/nixos/plymouth.nix b/modules/nixos/plymouth.nix index f5cdf5c..073ee14 100644 --- a/modules/nixos/plymouth.nix +++ b/modules/nixos/plymouth.nix @@ -10,7 +10,7 @@ let enable = cfg.enable && config.boot.plymouth.enable; in { - options.boot.plymouth.catppuccin = ctp.mkCatppuccinOpt "plymouth"; + options.boot.plymouth.catppuccin = ctp.mkCatppuccinOpt { name = "plymouth"; }; config.boot.plymouth = mkIf enable { theme = "catppuccin-${cfg.flavor}"; diff --git a/modules/nixos/sddm.nix b/modules/nixos/sddm.nix index e3b97fb..3f03b02 100644 --- a/modules/nixos/sddm.nix +++ b/modules/nixos/sddm.nix @@ -16,7 +16,7 @@ let in { - options.services.displayManager.sddm.catppuccin = ctp.mkCatppuccinOpt "sddm" // { + options.services.displayManager.sddm.catppuccin = ctp.mkCatppuccinOpt { name = "sddm"; } // { font = mkOption { type = types.str; default = "Noto Sans";