From 25b23ee693f031520932c624e27c7fbef8117bf1 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 24 Jan 2025 13:03:35 +0100 Subject: [PATCH] modules/hm/programs/terminal/emulators/ghostty: add service for faster startups --- .../programs/terminal/emulators/ghostty.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/hm/programs/terminal/emulators/ghostty.nix b/modules/hm/programs/terminal/emulators/ghostty.nix index 7ed7b57..ee9377f 100644 --- a/modules/hm/programs/terminal/emulators/ghostty.nix +++ b/modules/hm/programs/terminal/emulators/ghostty.nix @@ -1,5 +1,6 @@ { lib, + pkgs, osConfig, ... }: let @@ -44,11 +45,35 @@ in { programs.ghostty = lib.mkMerge [ { enable = true; + settings = { + font-family = ["monospace" "Symbols Nerd Font"]; + font-size = 14; + gtk-single-instance = true; + confirm-close-surface = false; + }; } (optionalAttrs styleCfg.enable { settings.theme = "base16"; themes.base16 = mkIf styleCfg.enable (mkGhosttyTheme styleCfg.scheme.palette); }) ]; + + systemd.user.services.ghosttyd = { + Unit = { + Description = "ghosttyd™"; + PartOf = "graphical-session.target"; + After = "graphical-session.target"; + }; + Service = { + Type = "simple"; + ExecStart = "${pkgs.ghostty}/bin/ghostty --initial-window=false --quit-after-last-window-closed=false"; + Slice = "background-graphical.slice"; + Restart = "on-failure"; + }; + + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; }; }