Skip to content

Commit

Permalink
Merge pull request #1009 from kachick/ghostty-step2
Browse files Browse the repository at this point in the history
Make ghostty as the default terminal
  • Loading branch information
kachick authored Dec 30, 2024
2 parents da5a361 + 499957f commit fe1c803
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 37 deletions.
11 changes: 10 additions & 1 deletion config/ghostty/config.common
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# macOS: cmd+shift+,

# See also 899be8e51cb288fe0ae91267f495ade7bfb80bc9
# FIXME: ghostty 1.0.1 Looks not to disable the blinking even if setting both.
# This disbling does not work on `nix run`. Installed in nixos and ran from launcher worked (from shell or gnome difference?.
cursor-style-blink = false
# See https://github.com/ghostty-org/ghostty/discussions/2812
shell-integration-features = no-cursor
cursor-style = bar

# Looks not appeared in Linux. Why? However I can omit this trivial thing.
background-opacity = 0.85
Expand All @@ -16,3 +18,10 @@ background-opacity = 0.85
# ghostty can set both dark and light. However always use dark for terminals
# theme = dark:ForestBlue,light:iTerm2 Tango Light
theme = ForestBlue
# Avoid the ligatures in "JetBrains Mono" by default
font-family = "PlemolJP Console NF"

# ghostty documents said setting true by default in Linux but macOS disabled.
# However keeping same behaviors should be useful if I use same tool in multuple environments.
# And just setting `true` did not work on my GNOME
copy-on-select = clipboard
2 changes: 0 additions & 2 deletions home-manager/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
pinentry_mac

# alacritty # Don't install macOS alacritty with nixpkgs. Alacritty often changes schema and I'm negative to use latest until https://github.com/NixOS/nixpkgs/issues/107466
kitty
# foot is only provided for Linux wayland

# Don't install firefox via nixpkgs for darwin, it is broken https://github.com/NixOS/nixpkgs/blob/bac526a0fe6da6b10cfe2454f62a0defdbf1d898/pkgs/applications/networking/browsers/firefox/packages.nix#L23

Expand Down
8 changes: 5 additions & 3 deletions home-manager/genericLinux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@

home = {
sessionVariables = {
# Make it possible to handle "xterm-kitty" in SSH remotes or lima guest VM with tiny filesize and setups. See GH-932
# Make it possible to handle special terminfo such as "xterm-kitty" in SSH remotes or lima guest VM with tiny filesize and setups. See GH-932
#
# Don't set this in NixOS desktop. It has own value.
TERMINFO_DIRS = "${pkgs.kitty.terminfo}/share/terminfo";
# - Don't set this in NixOS desktop. It has own value
# - Don't include `pkgs.ANYTTY` to avoid the build and or download large package. Use `pkgs.ANYTTY.terminfo`
# - Don't remove termnfo even if it is outdated
TERMINFO_DIRS = "${pkgs.kitty.terminfo}/share/terminfo:${pkgs.unstable.ghostty.terminfo}/share/terminfo";
};
};
}
7 changes: 4 additions & 3 deletions home-manager/gnome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ in
]
);

# Might be needed to reboot to enable icons
favorite-apps = [
"kitty.desktop"
"com.mitchellh.ghostty.desktop"
"dev.zed.Zed.desktop"
"google-chrome.desktop"
"podman-desktop.desktop"
Expand All @@ -54,7 +55,7 @@ in

# https://unix.stackexchange.com/questions/481142/launch-default-terminal-emulator-by-command
"org/gnome/desktop/default-applications/terminal" = {
exec = lib.getExe pkgs.kitty;
exec = lib.getExe pkgs.unstable.ghostty;
# exec-arg="";
};

Expand Down Expand Up @@ -153,7 +154,7 @@ in
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
name = "Terminal";
binding = "<Super>t";
command = lib.getExe pkgs.kitty;
command = lib.getExe pkgs.unstable.ghostty;
};

"org/gnome/shell/extensions/clipboard-history" = {
Expand Down
25 changes: 1 addition & 24 deletions home-manager/terminals.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, ... }:

{
xdg = {
Expand All @@ -19,27 +19,4 @@
};
};
};

# https://github.com/nix-community/home-manager/blob/release-24.11/modules/programs/kitty.nix
programs.kitty = {
enable = true;
package = pkgs.emptyDirectory;
themeFile = "zenwritten_dark"; # basename in a file of https://github.com/kovidgoyal/kitty-themes/tree/master/themes
settings = {
shell = lib.getExe pkgs.zsh;
cursor_shape = "beam";
cursor_blink_interval = 0;
copy_on_select = "clipboard";
tab_bar_edge = "top";
# tab_bar_style = "separator";
# tab_separator = " | ";
tab_bar_style = "slant";
};

# Avoiding a home-manager definition bug for rejecting all float.
# https://github.com/nix-community/home-manager/issues/4850
extraConfig = ''
background_opacity 0.85
'';
};
}
5 changes: 1 addition & 4 deletions nixos/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@
# https://github.com/NixOS/nixpkgs/issues/33282
xdg-user-dirs

foot
kitty

cyme
lshw

Expand All @@ -143,7 +140,7 @@

gdm-settings

# unstable.ghostty # TODO: Enable after introducing https://github.com/NixOS/nixpkgs/pull/368404
unstable.ghostty

alacritty

Expand Down

0 comments on commit fe1c803

Please sign in to comment.