ghostty: add background service
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
7be7cdef8e
commit
f65e7475e5
1 changed files with 25 additions and 0 deletions
|
@ -6,10 +6,14 @@
|
|||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.programs.ghostty;
|
||||
hm = config.home-manager.users.${config.custom.username};
|
||||
|
||||
ghostty = getExe hm.programs.ghostty.package;
|
||||
in {
|
||||
options.custom.programs.ghostty = {
|
||||
enable = mkOption {default = false;};
|
||||
minimal = mkOption {default = false;};
|
||||
service = mkOption {default = true;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -82,6 +86,27 @@ in {
|
|||
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"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue