Terminal emulator configuration

As a programmer, I spend a lot of my time in a terminal, so it better be configured right.

{ config, lib, ... }:
let
  cfg = config.mjm.terminal;
in
{
  options.mjm.terminal = {
    <<options>>
  };

  config = lib.mkIf cfg.enable {
    <<config>>
  };

  _class = "homeManager";
}

Options

enable = lib.mkOption {
  type = lib.types.bool;
  default = config.mjm.desktop.enable;
};

Terminal configuration is enabled by default on workstation machines.

font.family = lib.mkOption {
  type = lib.types.str;
  default = "PragmataPro Liga";
};
font.size = lib.mkOption {
  type = lib.types.int;
  default = 11;
};

These options configure the font family and size used in any terminal emulator. I've switched between several different terminals and fonts over time, so it's nice to have this configured in one common place.

Ghostty config

programs.ghostty.enable = true;
programs.ghostty.settings = {
  <<ghostty-config>>
};

I've been using Ghostty exclusively for a while now. I think it's the best terminal emulator, at least for the things I care about.

theme = "Dracula";

I mostly use Catppuccin themes for everything, but for a few things I've been favoring Dracula lately. Ghostty is one of those things.

font-family = cfg.font.family;
font-size = cfg.font.size;

The font family and size are set based on the module options. The size in particular might be adjusted for different machines, since they all have different displays which might have a different size that is comfortable to read.

gtk-titlebar-style = "tabs";
window-decoration = "none";

On Linux, stick the tabs in the titlebar. This compacts things and generally looks better to my eyes. Also hide the window decorations, because on Linux this eliminates a weird border in the corners that doesn't match the corner radius imposed by Niri.

Proxy Information
Original URL
gemini://midna.dev/homelab/modules/home-manager/terminal/
Status Code
Success (20)
Meta
text/gemini;lang=en-US
Capsule Response Time
23.394603 milliseconds
Gemini-to-HTML Time
0.177486 milliseconds

This content has been proxied by September (UNKNO).