rose-pine-nix/modules/home-manager/helix.nix

29 lines
606 B
Nix
Raw Normal View History

{
2024-10-19 23:02:44 -07:00
config,
lib,
...
}: let
inherit (config.rose-pine) sources;
2024-10-19 23:02:44 -07:00
cfg = config.programs.helix.rose-pine;
enable = cfg.enable && config.programs.helix.enable;
2024-10-19 23:02:44 -07:00
themeName =
if (cfg.flavor == "main")
then "rose_pine"
else "rose_pine_${cfg.flavor}";
in {
options.programs.helix.rose-pine = lib.rp.mkRosePineOpt {name = "helix";};
config = lib.mkIf enable {
programs.helix = {
settings = {
theme = themeName;
editor.color-modes = lib.mkDefault true;
};
2024-10-19 23:02:44 -07:00
themes."${themeName}" = lib.importTOML "${sources.helix}/${themeName}.toml";
};
};
}