{
  marleylib,
  config,
  osConfig,
  lib,
  pkgs,
  ...
}: let
  inherit (marleylib.module) mkEnableOption';

  cfg = config.marleyos.programs.wezterm;
  osCfg = osConfig.marleyos.programs.wezterm.enable or false;
in {
  options.marleyos.programs.wezterm.enable = mkEnableOption' "wezterm" osCfg;

  config = lib.mkIf cfg.enable {
    programs.wezterm = {
      enable = true;
      package = lib.mkIf pkgs.stdenv.isDarwin pkgs.emptyDirectory;

      # TODO: create `local config` & return it separately, so other modules can
      # insert config in the middle.
      extraConfig =
        # lua
        ''
          local config = wezterm.config_builder()

          -- Fix color blocks instead of text issue.
          config.front_end = "WebGpu"

          config.freetype_load_flags = 'NO_HINTING'

          config.enable_tab_bar = false

          return config
        '';
    };
  };
}
