2023-07-13 09:17:51 -07:00
|
|
|
{ config
|
|
|
|
, pkgs
|
|
|
|
, lib
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (builtins) fromTOML readFile;
|
|
|
|
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-07-13 09:17:51 -07:00
|
|
|
ctp.mkCatppuccinOpt "helix" config
|
|
|
|
// {
|
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
|
|
|
|
|
|
|
themes."catppuccin-${cfg.flavour}" = fromTOML (readFile (pkgs.fetchFromGitHub
|
2023-04-18 17:01:16 -07:00
|
|
|
{
|
|
|
|
owner = "catppuccin";
|
|
|
|
repo = "helix";
|
|
|
|
rev = "5677c16dc95297a804caea9161072ff174018fdd";
|
|
|
|
sha256 = "sha256-aa8KZ7/1TXcBqaV/TYOZ8rpusOf5QeQ9i2Upnncbziw=";
|
2023-07-13 09:17:51 -07:00
|
|
|
}
|
|
|
|
+ "/themes/${subdir}/catppuccin_${cfg.flavour}.toml"));
|
2023-04-14 19:37:39 -07:00
|
|
|
};
|
|
|
|
}
|