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; + }; +}