From ff6c4c5d166f75c046c516d31a007bc8a076982e Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Fri, 16 Feb 2024 00:02:19 +0800 Subject: [PATCH] feat: add Ghostty --- home/apps/ghostty.conf | 16 ++++++++++++++++ home/apps/ghostty.nix | 3 +++ home/default.nix | 1 + home/programs/fish/conf.d/99_interactive.fish | 8 +++++--- home/programs/zsh/initExtra.zsh | 5 ++++- modules/nix.nix | 12 +----------- 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 home/apps/ghostty.conf create mode 100644 home/apps/ghostty.nix diff --git a/home/apps/ghostty.conf b/home/apps/ghostty.conf new file mode 100644 index 0000000..fdd79bb --- /dev/null +++ b/home/apps/ghostty.conf @@ -0,0 +1,16 @@ +theme = catppuccin-frappe + +font-family = "Ryan Term" +font-family = "Symbols Nerd Font" +font-size = 13 +adjust-cell-height = 50% +adjust-underline-position = 5 + +command = /run/current-system/sw/bin/fish -l +shell-integration = fish +shell-integration-features = cursor, sudo + +macos-titlebar-tabs = true + +window-padding-x = 15 +window-padding-y = 15 diff --git a/home/apps/ghostty.nix b/home/apps/ghostty.nix new file mode 100644 index 0000000..5c3ea08 --- /dev/null +++ b/home/apps/ghostty.nix @@ -0,0 +1,3 @@ +{config, ...}: { + home.file."${config.xdg.configHome}/ghostty/config".source = ./ghostty.conf; +} diff --git a/home/default.nix b/home/default.nix index 8b2814e..dd454f6 100644 --- a/home/default.nix +++ b/home/default.nix @@ -13,6 +13,7 @@ ./fonts.nix ./apps/vscode.nix + ./apps/ghostty.nix ./programs/zsh.nix ./programs/fish.nix diff --git a/home/programs/fish/conf.d/99_interactive.fish b/home/programs/fish/conf.d/99_interactive.fish index 3aead30..9d1c872 100644 --- a/home/programs/fish/conf.d/99_interactive.fish +++ b/home/programs/fish/conf.d/99_interactive.fish @@ -2,7 +2,9 @@ if status is-interactive # nix-your-shell nix-your-shell fish | source - if test -e "$HOME/.iterm2_shell_integration.fish" - source "$HOME/.iterm2_shell_integration.fish" - end + string match -q "$TERM_PROGRAM" "iTerm.app" + and source "$HOME/.iterm2_shell_integration.fish" + + string match -q "$TERM_PROGRAM" ghostty + and source "/Applications/Ghostty.app/Contents/Resources/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish" end diff --git a/home/programs/zsh/initExtra.zsh b/home/programs/zsh/initExtra.zsh index 706bd9c..331b74d 100644 --- a/home/programs/zsh/initExtra.zsh +++ b/home/programs/zsh/initExtra.zsh @@ -23,4 +23,7 @@ function take() { eval "$(nix-your-shell zsh)" # iTerm -[ -e "$HOME/.iterm2_shell_integration.zsh" ] && source "$HOME/.iterm2_shell_integration.zsh" +[[ "$TERM_PROGRAM" == "iTerm.app" ]] && source "$HOME/.iterm2_shell_integration.zsh" + +# Ghostty +[[ "$TERM_PROGRAM" == "ghostty" ]] && source "/Applications/Ghostty.app/Contents/Resources/ghostty/shell-integration/zsh/ghostty-integration" diff --git a/modules/nix.nix b/modules/nix.nix index d553e1f..e4c3d56 100644 --- a/modules/nix.nix +++ b/modules/nix.nix @@ -25,17 +25,7 @@ in { build-users-group = "nixbld"; trusted-users = ["ryanccn"]; sandbox = true; - - extra-substituters = [ - "https://nix-community.cachix.org" - "https://crane.cachix.org" - "https://cache.garnix.io" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=" - "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - ]; + use-xdg-base-directories = true; nix-path = config.nix.nixPath; };