{
  config,
  lib,
  ...
}: let
  cfg = config.console.rose-pine;
  enable = cfg.enable && config.console.enable;

  palette = (lib.importJSON "../../.sources/palette.json").${cfg.flavor}.colors;
in {
  options.console.rose-pine = lib.rp.mkRosePineOpt {name = "console";};

  config.console.colors = lib.mkIf enable (
    # Manually populate with colors from rose-pine/linux-tty
    # Make sure to strip initial # from hex codes
    map (color: (builtins.substring 1 6 palette.${color}.hex)) [
      "base"
      "love"
      "foam"
      "gold"
      "pine"
      "iris"
      "rose"
      "text"

      "overlay"
      "love"
      "foam"
      "gold"
      "pine"
      "iris"
      "rose"
      "text"
    ]
  );
}
