{ config, ... }:
let
  generateOptions =
    with builtins;
    (opts: toString (attrValues (mapAttrs (name: value: "--${name} ${toString value}") opts)));
in
{
  # TODO: global colorscheme vars for everything
  console.colors = [
    "282828"
    "cc241d"
    "98971a"
    "d79921"
    "458588"
    "b16286"
    "689d6a"
    "a89984"
    "928374"
    "fb4934"
    "b8bb26"
    "fabd2f"
    "83a598"
    "d3869b"
    "8ec07c"
    "ebdbb2"
  ];

  services.kmscon = {
    enable = true;
    extraConfig = "font-size=14";
    extraOptions = generateOptions {
      xkb-layout = config.services.xserver.xkb.layout;
      xkb-variant = config.services.xserver.xkb.variant;
    };
    hwRender = true;
  };
}
