{
  lib,
  config,
  pkgs,
  ...
}: let
  inherit (lib) mkEnableOption mkIf;
  cfg = config.horseman.apps.terminal;
  username = config.horseman.username;
in {
  options = {
    horseman.apps.terminal = {
      enable = mkEnableOption "Apps that run only in terminal without a GUI";
    };
  };

  imports = [
    ./zsh.nix
  ];

  config = mkIf cfg.enable {
    home-manager.users.${username} = {
      imports = [./helix.nix];
    };

    horseman.dots = {
      eza.enable = true;
    };

    environment.variables = {
      EDITOR = "hx";
      TERM = "kitty";
    };

    services.lorri.enable = true;

    environment.systemPackages = with pkgs; [
      bat
      btop
      cowsay
      direnv
      docker-compose
      ethtool
      eza
      file
      fzf
      gcc
      gnupg
      jq
      neofetch
      nodejs_22
      pandoc
      sops
      sxiv
      termdown
      texliveTeTeX
      tmux
      unzip
      wakeonlan
      zip
    ];

    # Docker
    virtualisation.docker.enable = true;
    users.users.${username}.extraGroups = ["docker"];
  };
}
