{
  pkgs,
  lib,
  config,
  ...
}:
let
  inherit (lib) mkEnableOption mkOption mkIf;
  inherit (lib.types) listOf package;
  cfg = config.modules.system.roles.terminal;
in
{
  options.modules.system.roles.terminal = {
    enable = mkEnableOption "terminal packages" // {
      default = true;
      defaultText = ''
        Enable by default, most systems will need a common set of CLI tools.
      '';
    };
    extraPackages = mkOption {
      type = listOf package;
      default = [ ];
    };
    defaultPackages = mkOption {
      type = listOf package;
      default = with pkgs; [
        btop
        eza
        bat
        fish
        cyme
        lsof
        git
        delta
        fzf
        zip
        unzip
        fd
        ripgrep
      ];
    };
  };

  config = mkIf cfg.enable {
    environment.systemPackages = cfg.extraPackages ++ cfg.defaultPackages;
  };
}
