old
1{
2 den,
3 lib,
4 ...
5}: {
6 den.aspects.desktop.terminal.ghostty = {
7 includes = [den.aspects.desktop.terminal];
8
9 homeManager = {
10 host,
11 user,
12 ...
13 }: let
14 fontsCfg = host.settings.desktop.style.fonts;
15 in {
16 xdg.terminal-exec.settings.default =
17 if (user.system.settings.desktop.terminal.default == "ghostty")
18 then lib.mkBefore ["com.mitchellh.ghostty.desktop"]
19 else lib.mkAfter ["com.mitchellh.ghostty.desktop"];
20
21 programs.ghostty = {
22 enable = true;
23 enableBashIntegration = true;
24
25 settings = {
26 font-family = lib.concatMap (f: f.name) (fontsCfg.monospace.name ++ fontsCfg.emoji.name);
27 font-size = fontsCfg.sizes.terminal;
28 window-padding-x = 5;
29 window-padding-y = 5;
30 window-padding-balance = true;
31 };
32 };
33 };
34 };
35
36 den.aspects.desktop.terminal.ghostty.themes = {
37 catppuccin = {
38 homeManager = {pkgs, ...}: {
39 xdg.configFile."ghostty/themes/catppuccin-latte.conf".source = pkgs.fetchurl {
40 pname = "ghostty-theme-catppuccin-latte.conf";
41 url = "https://github.com/catppuccin/ghostty/raw/5a58926563ddacbde4a12b4a347464c2c6945393/themes/catppuccin-latte.conf";
42 hash = "sha256-S+V2DXWakPAHpwyhgZrgmrHbDIScRi8/O0RZD1EQrvU=";
43 };
44 xdg.configFile."ghostty/themes/catppuccin-mocha.conf".source = pkgs.fetchurl {
45 pname = "ghostty-theme-catppuccin-mocha.conf";
46 url = "https://github.com/catppuccin/ghostty/raw/5a58926563ddacbde4a12b4a347464c2c6945393/themes/catppuccin-mocha.conf";
47 hash = "sha256-/NwPBF9o16h5f/Xx06dniLwX3VO0Z8Bbe9Zb0UoBMx4=";
48 };
49
50 programs.ghostty = {
51 settings = {
52 theme = "light:catppuccin-latte.conf,dark:catppuccin-mocha.conf";
53 };
54 };
55 };
56 };
57 };
58}