{
  config,
  lib,
  ...
}: let
  inherit (config.rose-pine) sources;
  cfg = config.programs.alacritty.rose-pine;
  enable = cfg.enable && config.programs.alacritty.enable;
in {
  options.programs.alacritty.rose-pine = lib.rp.mkRosePineOpt {name = "alacritty";};

  config = lib.mkIf enable {
    programs.alacritty.settings =
      if (cfg.flavor == "main")
      then lib.importTOML "${sources.alacritty}/dist/rose-pine.toml"
      else lib.importTOML "${sources.alacritty}/dist/rose-pine-${cfg.flavor}.toml";
  };
}
