rose-pine-nix/modules/home-manager/helix.nix
2024-05-21 22:53:46 +01:00

29 lines
770 B
Nix

{ config, lib, ... }:
let
inherit (config.catppuccin) sources;
cfg = config.programs.helix.catppuccin;
enable = cfg.enable && config.programs.helix.enable;
in
{
options.programs.helix.catppuccin =
with lib;
ctp.mkCatppuccinOpt "helix"
// {
useItalics = mkEnableOption "Italics in Catppuccin theme for Helix";
};
config.programs.helix =
let
subdir = if cfg.useItalics then "default" else "no_italics";
in
lib.mkIf enable {
settings = {
theme = "catppuccin-${cfg.flavour}";
editor.color-modes = lib.mkDefault true;
};
themes."catppuccin-${cfg.flavour}" = builtins.fromTOML (
builtins.readFile "${sources.helix}/themes/${subdir}/catppuccin_${cfg.flavour}.toml"
);
};
}