From 233ba91309143a582a23682226648292b774ea90 Mon Sep 17 00:00:00 2001 From: moons Date: Sun, 2 Aug 2026 21:57:19 +0900 Subject: [PATCH] ghostty --- .../ghostty/{home.nix => home/common.nix} | 33 +------------------ modules/applications/ghostty/home/darwin.nix | 17 ++++++++++ .../ghostty/{ => home}/dracula.theme | 0 modules/applications/ghostty/home/nixos.nix | 6 ++++ 4 files changed, 24 insertions(+), 32 deletions(-) rename modules/applications/ghostty/{home.nix => home/common.nix} (61%) create mode 100644 modules/applications/ghostty/home/darwin.nix rename modules/applications/ghostty/{ => home}/dracula.theme (100%) create mode 100644 modules/applications/ghostty/home/nixos.nix diff --git a/modules/applications/ghostty/home.nix b/modules/applications/ghostty/home/common.nix similarity index 61% rename from modules/applications/ghostty/home.nix rename to modules/applications/ghostty/home/common.nix index b1ba9f0..bbcb3ef 100644 --- a/modules/applications/ghostty/home.nix +++ b/modules/applications/ghostty/home/common.nix @@ -1,23 +1,6 @@ -{ - inputs, - lib, - pkgs, - ... -}: -let - isDarwin = pkgs.stdenv.hostPlatform.isDarwin; - isLinux = pkgs.stdenv.hostPlatform.isLinux; - package = - if isLinux then - inputs.ghostty.packages.${pkgs.stdenv.hostPlatform.system}.ghostty-releasefast - else - null; -in -{ +_: { programs.ghostty = { enable = true; - inherit package; - systemd.enable = isLinux; settings = { theme = "dracula"; @@ -50,19 +33,5 @@ in }; }; - # Global Ghostty keybindings are handled by the running app. Start it hidden - # at login so Option+T and Option+Space work before opening a terminal. - launchd.agents.ghostty-global-keybindings = lib.mkIf isDarwin { - enable = true; - config = { - ProgramArguments = [ - "/usr/bin/open" - "-gja" - "Ghostty" - ]; - RunAtLoad = true; - }; - }; - xdg.configFile."ghostty/themes/dracula".source = ./dracula.theme; } diff --git a/modules/applications/ghostty/home/darwin.nix b/modules/applications/ghostty/home/darwin.nix new file mode 100644 index 0000000..b8d6853 --- /dev/null +++ b/modules/applications/ghostty/home/darwin.nix @@ -0,0 +1,17 @@ +_: { + # Global Ghostty keybindings are handled by the running app. Start it hidden + # at login so Option+T and Option+Space work before opening a terminal. + launchd.agents.ghostty-global-keybindings = { + enable = true; + config = { + ProgramArguments = [ + "/usr/bin/open" + "-gja" + "Ghostty" + ]; + RunAtLoad = true; + }; + }; + + programs.ghostty.package = null; +} diff --git a/modules/applications/ghostty/dracula.theme b/modules/applications/ghostty/home/dracula.theme similarity index 100% rename from modules/applications/ghostty/dracula.theme rename to modules/applications/ghostty/home/dracula.theme diff --git a/modules/applications/ghostty/home/nixos.nix b/modules/applications/ghostty/home/nixos.nix new file mode 100644 index 0000000..a5d47a4 --- /dev/null +++ b/modules/applications/ghostty/home/nixos.nix @@ -0,0 +1,6 @@ +{ inputs, pkgs, ... }: { + programs.ghostty = { + systemd.enable = true; + package = inputs.ghostty.packages.${pkgs.stdenv.hostPlatform.system}.ghostty-releasefast; + }; +}