From 36e3d42ab719812029652787dbe08ec061a93c38 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Fri, 4 Jul 2025 00:57:44 -0500 Subject: [PATCH] added ghostty module --- flake.nix | 1 + home.nix | 1 + homeManagerModules/ghostty.nix | 47 ++++++++++++++++++++++++++++++++++ nixosModules/options.nix | 6 +++++ 4 files changed, 55 insertions(+) create mode 100644 homeManagerModules/ghostty.nix diff --git a/flake.nix b/flake.nix index 40dd351..7fb4e93 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,7 @@ ssh = config.ssh; _1password = config._1password; docker = config.docker; + graphical = config.graphical; } ] ++ config.extraImports; diff --git a/home.nix b/home.nix index 28144aa..bc185eb 100644 --- a/home.nix +++ b/home.nix @@ -3,6 +3,7 @@ { imports = [ ./homeManagerModules/git.nix + ./homeManagerModules/ghostty.nix ./homeManagerModules/shell.nix ./homeManagerModules/ssh.nix ./homeManagerModules/docker.nix diff --git a/homeManagerModules/ghostty.nix b/homeManagerModules/ghostty.nix new file mode 100644 index 0000000..a0fe011 --- /dev/null +++ b/homeManagerModules/ghostty.nix @@ -0,0 +1,47 @@ +{ config, pkgs, lib, ... }: +{ + home.sessionVariables = lib.mkIf (config.enableShell and config.graphical) { + TERMINAL = "ghostty"; + }; + + programs.ghostty = lib.mkIf (config.enableShell and config.graphical) { + enable = true; + enableZshIntegration = true; + settings = { + # command = "TERM=xterm-256color /usr/bin/bash"; + font-size = 12; + font-family = "Source Code Pro"; + # theme = "idleToes"; + # theme = "CGA"; + theme = "catppuccin-mocha"; + # theme = "CobaltNext"; + # clipboard-read = "allow"; + copy-on-select = true; + shell-integration = "zsh"; + shell-integration-features = [ "no-title" "sudo" ]; + gtk-single-instance = true; + + window-padding-balance = true ; + window-padding-x = 5; + window-padding-y = 5; + initial-window = true; + resize-overlay = "never"; + + # Example: https://gist.github.com/adibhanna/c552c452fb244b3b721e3c2432e85cde + keybind = [ + "ctrl+s>n=new_split:down" + "ctrl+t>n=new_tab" + "ctrl+t>1=goto_tab:1" + "ctrl+t>2=goto_tab:2" + "ctrl+t>3=goto_tab:3" + "ctrl+s>i=goto_split:up" + "ctrl+s>k=goto_split:down" + ]; + + # window-position-x = 500; + # window-position-y = 500; + window-height = 40; + window-width = 200; + }; + }; +} \ No newline at end of file diff --git a/nixosModules/options.nix b/nixosModules/options.nix index f20932d..3265761 100644 --- a/nixosModules/options.nix +++ b/nixosModules/options.nix @@ -59,4 +59,10 @@ default = false; description = "Whether to enable docker stuff"; }; + + options.graphical = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Whether this system has a graphical environment"; + }; }