2023-07-13 09:17:51 -07:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
2024-05-13 13:33:16 -07:00
|
|
|
inherit (config.catppuccin) sources;
|
2023-07-13 09:17:51 -07:00
|
|
|
cfg = config.programs.helix.catppuccin;
|
|
|
|
enable = cfg.enable && config.programs.helix.enable;
|
|
|
|
in
|
|
|
|
{
|
2023-04-17 09:44:07 -07:00
|
|
|
options.programs.helix.catppuccin = with lib;
|
2023-11-02 10:55:47 -07:00
|
|
|
ctp.mkCatppuccinOpt "helix"
|
2023-07-13 09:17:51 -07:00
|
|
|
// {
|
2023-04-17 09:44:07 -07:00
|
|
|
useItalics = mkEnableOption "Italics in Catppuccin theme for Helix";
|
2023-04-14 19:37:39 -07:00
|
|
|
};
|
|
|
|
|
2023-07-13 09:17:51 -07:00
|
|
|
config.programs.helix =
|
|
|
|
let
|
|
|
|
subdir =
|
|
|
|
if cfg.useItalics
|
|
|
|
then "default"
|
|
|
|
else "no_italics";
|
|
|
|
in
|
|
|
|
lib.mkIf enable {
|
2023-04-14 19:37:39 -07:00
|
|
|
settings = {
|
|
|
|
theme = "catppuccin-${cfg.flavour}";
|
2023-07-13 09:17:51 -07:00
|
|
|
editor.color-modes = lib.mkDefault true;
|
2023-04-14 19:37:39 -07:00
|
|
|
};
|
2023-07-13 09:17:51 -07:00
|
|
|
|
2023-11-02 10:55:47 -07:00
|
|
|
themes."catppuccin-${cfg.flavour}" = builtins.fromTOML
|
|
|
|
(builtins.readFile "${sources.helix}/themes/${subdir}/catppuccin_${cfg.flavour}.toml");
|
2023-04-14 19:37:39 -07:00
|
|
|
};
|
|
|
|
}
|