1
1
Fork 0

ghostty: add background service

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2025-02-12 13:21:31 -06:00
parent 7be7cdef8e
commit f65e7475e5
Signed by: Myned
GPG key ID: C7224454F7881A34

View file

@ -6,10 +6,14 @@
}: }:
with lib; let with lib; let
cfg = config.custom.programs.ghostty; cfg = config.custom.programs.ghostty;
hm = config.home-manager.users.${config.custom.username};
ghostty = getExe hm.programs.ghostty.package;
in { in {
options.custom.programs.ghostty = { options.custom.programs.ghostty = {
enable = mkOption {default = false;}; enable = mkOption {default = false;};
minimal = mkOption {default = false;}; minimal = mkOption {default = false;};
service = mkOption {default = true;};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -82,6 +86,27 @@ in {
window-padding-y = 4; window-padding-y = 4;
}; };
}; };
# HACK: Launch in background to decrease GTK startup delay
# https://github.com/ghostty-org/ghostty/discussions/2978
systemd.user.services = mkIf cfg.service {
ghostty = {
Unit = {
Description = "Ghostty Background Service";
After = ["xdg-desktop-autostart.target"];
};
Service = {
BusName = "com.mitchellh.ghostty";
ExecStart = "${ghostty} --initial-window=false --quit-after-last-window-closed=false";
Type = "dbus";
};
Install = {
WantedBy = ["xdg-desktop-autostart.target"];
};
};
};
} }
]; ];
}; };