nixos/shared/modules/apps/ghostty.nix

45 lines
997 B
Nix

{lib, config, ...}:
let
cfg = config.ghosttyApp;
in
{
options.ghosttyApp = {
enable = lib.mkEnableOption "enable ghostty terminal";
fontFamily = lib.mkOption {
type = lib.types.str;
default = "Maple Mono NF";
description = "Font family to use in ghostty";
};
enableLigatures = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Enable font ligatures in ghostty";
};
};
config = lib.mkIf cfg.enable {
programs.ghostty = {
enable = true;
settings = {
font-family = cfg.fontFamily;
# Ligatures - Maple Mono NF has full ligature support
font-feature = lib.mkIf cfg.enableLigatures [
"+calt" # contextual alternates
"+liga" # standard ligatures
];
window-padding-x = 4;
window-padding-y = 4;
keybind = [
"ctrl+shift+plus=increase_font_size:1"
"shift+enter=text:\\n"
];
};
};
};
}