diff --git a/darwin/casks.nix b/darwin/casks.nix index b50cd1d..b889b91 100644 --- a/darwin/casks.nix +++ b/darwin/casks.nix @@ -3,7 +3,6 @@ # Development Tools "claude" "claude-code" - "ghostty" "minizincide" "sublime-merge" "vscodium" diff --git a/darwin/default.nix b/darwin/default.nix index e6cd989..9828991 100644 --- a/darwin/default.nix +++ b/darwin/default.nix @@ -65,14 +65,9 @@ in on-focused-monitor-changed = ["move-mouse monitor-lazy-center"]; mode.main.binding = { - # Open a new Ghostty window. - # See: https://nikitabobko.github.io/AeroSpace/goodies#open-a-new-window-with-applescript - alt-enter = '' - exec-and-forget osascript -e ' - tell application "Ghostty" - new window - end tell' - ''; + # Open a new kitty window. --single-instance (set via + # darwinLaunchOptions) makes this reuse the running instance. + alt-enter = "exec-and-forget open -na kitty"; # Vim-style focus, wrapping around the workspace like i3 alt-h = "focus --boundaries-action wrap-around-the-workspace left"; diff --git a/darwin/home-manager.nix b/darwin/home-manager.nix index 0373057..ef1e798 100644 --- a/darwin/home-manager.nix +++ b/darwin/home-manager.nix @@ -75,6 +75,10 @@ git.settings.gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; jujutsu.settings.signing.backends.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; + # open(1) launches kitty with cwd=/, and new windows inherit the cwd + # of the process that asked for them, so pin it to $HOME + kitty.darwinLaunchOptions = [ "--single-instance" "--directory=${config.home.homeDirectory}" ]; + skim.enable = true; zsh.initContent = '' diff --git a/shared/config/starship-tokyo-night.toml b/shared/config/starship-tokyo-night.toml deleted file mode 100644 index 4972a7b..0000000 --- a/shared/config/starship-tokyo-night.toml +++ /dev/null @@ -1,64 +0,0 @@ -format = """ -[░▒▓](#a3aed2)\ -[  ](bg:#a3aed2 fg:#090c0c)\ -[](bg:#769ff0 fg:#a3aed2)\ -$directory\ -[](fg:#769ff0 bg:#394260)\ -$git_branch\ -$git_status\ -[](fg:#394260 bg:#212736)\ -$nodejs\ -$rust\ -$golang\ -$php\ -[](fg:#212736 bg:#1d2230)\ -$time\ -[ ](fg:#1d2230)\ -\n$character""" - -[directory] -style = "fg:#e3e5e5 bg:#769ff0" -format = "[ $path ]($style)" -truncation_length = 3 -truncation_symbol = "…/" - -[directory.substitutions] -"Documents" = "󰈙 " -"Downloads" = " " -"Music" = " " -"Pictures" = " " - -[git_branch] -symbol = "" -style = "bg:#394260" -format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)' - -[git_status] -style = "bg:#394260" -format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)' - -[nodejs] -symbol = "" -style = "bg:#212736" -format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' - -[rust] -symbol = "" -style = "bg:#212736" -format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' - -[golang] -symbol = "" -style = "bg:#212736" -format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' - -[php] -symbol = "" -style = "bg:#212736" -format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' - -[time] -disabled = false -time_format = "%R" # Hour:Minute Format -style = "bg:#1d2230" -format = '[[  $time ](fg:#a0a9cb bg:#1d2230)]($style)' diff --git a/shared/home-manager.nix b/shared/home-manager.nix index b0be6c5..d672dde 100644 --- a/shared/home-manager.nix +++ b/shared/home-manager.nix @@ -1,4 +1,4 @@ -{ pkgs, email, name, sshSignKey, ... }: +{ lib, pkgs, email, name, sshSignKey, ... }: let in { @@ -19,7 +19,7 @@ in }; ghostty = { - enable = true; + enable = false; enableZshIntegration = true; installBatSyntax = false; # Install using Homebrew because of build failure @@ -120,17 +120,29 @@ in }; kitty = { - darwinLaunchOptions = [ "--single-instance" ]; - enable = false; + enable = true; font = { - name = "Iosevka Nerd Font"; + name = "Iosevka Nerd Font Mono"; size = 14; }; settings = { cursor_shape = "underline"; confirm_os_window_close = 0; + # Iosevka's own icons are squeezed into one narrow cell and look tiny. + # kitty ships a Nerd Font symbol face that it renders at full width by + # borrowing the following space, so programs.starship.settings below + # pads every icon with an extra space; drop both together if you ever + # revert this. + symbol_map = "U+E000-U+F8FF,U+F0000-U+FFFFD,U+100000-U+10FFFD Symbols Nerd Font Mono"; + # Lift the glyphs within the cell so they sit centred in the powerline + # blocks instead of hugging the bottom of the line. + modify_font = "baseline 2"; + }; + autoThemeFiles = { + light = "Catppuccin-Latte"; + dark = "Catppuccin-Frappe"; + noPreference = "Catppuccin-Latte"; }; - themeFile = "Catppuccin-Latte"; }; ssh = { @@ -167,9 +179,28 @@ in starship = { enable = true; - settings = (with builtins; fromTOML (readFile ./config/starship-tokyo-night.toml)) // { - # Overrides - }; + settings = + let + preset = fromTOML (builtins.readFile + "${pkgs.starship}/share/starship/presets/catppuccin-powerline.toml"); + # kitty draws Nerd Font glyphs double-width by swallowing the space + # that follows them, so every icon carries one more space than it + # should need. See programs.kitty.settings.symbol_map above. + pad = str: if str == "" then str else str + " "; + padSymbol = _: value: + if builtins.isAttrs value && value ? symbol && builtins.isString value.symbol + then value // { symbol = pad value.symbol; } + else value; + in + lib.recursiveUpdate (lib.mapAttrs padSymbol preset) { + # kitty follows the OS between Latte and Frappe, but starship has no + # equivalent, so it is pinned to the dark one. + palette = "catppuccin_latte"; + os.symbols = lib.mapAttrs (_: pad) preset.os.symbols; + directory.substitutions = lib.mapAttrs (_: pad) preset.directory.substitutions; + time.format = builtins.replaceStrings [" $time"] [" $time"] preset.time.format; + cmd_duration.format = builtins.replaceStrings [" in"] [" in"] preset.cmd_duration.format; + }; }; topgrade = { @@ -218,8 +249,6 @@ in start = "open"; less = "bat"; ls = "eza"; - # set-light-theme = "kitty +kitten themes Catppuccin-Latte"; - # set-dark-theme = "kitty +kitten themes Catppuccin-Frappe"; }; sessionVariables = { # Set default editor