Skip to content

Commit 8cfccf7

Browse files
lemtoccodex
andcommitted
feat(shell): restore zsh as default shell
- Switch nix-darwin and Home Manager shell wiring from fish to zsh - Port zsh snippets and Codex helper commands from fish - Update shell benchmark workflows and editor defaults for zsh Co-authored-by: Codex GPT-5.5 <noreply@openai.com>
1 parent 68ec3e2 commit 8cfccf7

15 files changed

Lines changed: 84 additions & 31 deletions

File tree

.github/actions/run-benchmark/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Run Benchmark
2-
description: Run fish startup benchmark with hyperfine and convert results
2+
description: Run zsh startup benchmark with hyperfine and convert results
33

44
outputs:
55
result-path:
@@ -16,7 +16,7 @@ runs:
1616
--warmup 10 \
1717
--runs 50 \
1818
--export-json bench-result.json \
19-
'fish -i -c exit'
19+
'zsh -i -c exit'
2020
2121
- name: Convert to benchmark format
2222
shell: bash

.github/actions/setup-bench-env/action.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Setup Benchmark Environment
2-
description: Install Nix, build home-manager generation, and set up fish shell environment for benchmarking
2+
description: Install Nix, build home-manager generation, and set up zsh shell environment for benchmarking
33

44
outputs:
55
hm_gen:
@@ -29,7 +29,7 @@ runs:
2929
# - /etc/zprofile: remove path_helper (slow PATH construction)
3030
# - /etc/zshrc: remove compinit/promptinit (nix-darwin sets enableGlobalCompInit=false)
3131
# - /etc/zshenv: keep Nix daemon setup for PATH
32-
# See hosts/common/default.nix:19-23
32+
# See hosts/common/default.nix for the matching nix-darwin zsh settings.
3333
sudo sh -c '
3434
echo "" > /etc/zprofile
3535
echo "" > /etc/zshrc
@@ -39,6 +39,11 @@ runs:
3939
sudo mkdir -p /Users/t1190078
4040
sudo chown "$(whoami)" /Users/t1190078
4141
42+
# Symlink user-level zsh dotfiles
43+
ln -sf "$HM_GEN/home-files/.zshrc" ~/.zshrc
44+
ln -sf "$HM_GEN/home-files/.zshenv" ~/.zshenv
45+
ln -sf "$HM_GEN/home-files/.zprofile" ~/.zprofile
46+
4247
# Symlink .config directories
4348
mkdir -p ~/.config
4449
for item in "$HM_GEN/home-files/.config/"*; do
@@ -51,9 +56,14 @@ runs:
5156
export PATH="$HM_GEN/home-path/bin:$PATH"
5257
echo "$HM_GEN/home-path/bin" >> "$GITHUB_PATH"
5358
59+
# Pre-populate sheldon cache (first run clones plugins via git)
60+
mkdir -p ~/.cache/sheldon
61+
sheldon lock
62+
sheldon source > ~/.cache/sheldon/sheldon.zsh
63+
readlink ~/.config/sheldon/plugins.toml > ~/.cache/sheldon/sheldon.zsh.lock
64+
5465
# Warm the mise cache BEFORE benchmarking so we measure realistic
55-
# warm-start behaviour. Otherwise `mise hook-env` (run from fish's
56-
# activation hook on every startup) resolves the dynamic `latest`/`lts`
66+
# warm-start behaviour. Otherwise shell activation can resolve dynamic `latest`/`lts`
5767
# tool versions over the GitHub API inside the measured region, adding
5868
# 100s of ms of nondeterministic noise that trips the 150% alert.
5969
# `mise install` lays down the tools so hook-env never touches the

.github/workflows/benchmark-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Fish Startup Benchmark (PR)
1+
name: Zsh Startup Benchmark (PR)
22

33
on:
44
pull_request:
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
benchmark:
16-
name: Fish Startup Time
16+
name: Zsh Startup Time
1717
runs-on: macos-latest
1818
timeout-minutes: 30
1919
steps:
@@ -30,7 +30,7 @@ jobs:
3030
- name: Comment benchmark result on PR
3131
uses: benchmark-action/github-action-benchmark@v1
3232
with:
33-
name: Fish Startup Time
33+
name: Zsh Startup Time
3434
tool: customSmallerIsBetter
3535
output-file-path: benchmark-result.json
3636
benchmark-data-dir-path: .

.github/workflows/benchmark.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Fish Startup Benchmark
1+
name: Zsh Startup Benchmark
22

33
on:
44
push:
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
benchmark:
17-
name: Fish Startup Time
17+
name: Zsh Startup Time
1818
runs-on: macos-latest
1919
timeout-minutes: 30
2020
steps:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Store benchmark result
3232
uses: benchmark-action/github-action-benchmark@v1
3333
with:
34-
name: Fish Startup Time
34+
name: Zsh Startup Time
3535
tool: customSmallerIsBetter
3636
output-file-path: benchmark-result.json
3737
benchmark-data-dir-path: .

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ macOS dotfiles managed with Nix flakes, nix-darwin, and home-manager.
4848
7. Reload your shell:
4949

5050
```bash
51-
exec fish
51+
exec zsh
5252
```
5353

5454
[^1]: The first run may fail. If it does, just run the same command again and it should succeed.

chezmoi/private_Library/private_Application Support/Code/User/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"tailwind-fold.autoFold": false,
8080
"tailwind-fold.unfoldedTextOpacity": 0.7,
8181
"terminal.external.osxExec": "Warp.app",
82-
"terminal.integrated.defaultProfile.osx": "fish",
82+
"terminal.integrated.defaultProfile.osx": "zsh",
8383
"terminal.integrated.env.osx": {
8484
"Q_NEW_SESSION": "1"
8585
},

home/pkgs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ pkgs, ... }:
22
{
3-
# fish, zoxide, eza, fzf, direnv are managed by programs.* modules (home/shell/*.nix)
3+
# zoxide, eza, fzf, direnv, starship are managed by programs.* modules (home/shell/*.nix)
44
# gh is managed by programs.gh (home/gh.nix)
55
home.packages = with pkgs; [
66
# Language runtimes & package managers

home/shell/default.nix

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
{ ... }:
22
{
33
imports = [
4-
./fish.nix
4+
./zsh.nix
5+
./starship.nix
56
./zoxide.nix
67
./direnv.nix
78
./mise.nix
89
./eza.nix
910
./fzf.nix
1011
];
1112

13+
# Hardcoded output of `brew shellenv` to avoid spawning brew binary (~15ms).
14+
# The output is constant on Apple Silicon, so safe to inline.
15+
programs.zsh.profileExtra = ''
16+
export HOMEBREW_PREFIX="/opt/homebrew"
17+
export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
18+
export HOMEBREW_REPOSITORY="/opt/homebrew"
19+
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin''${PATH:+:''${PATH}}"
20+
export MANPATH="/opt/homebrew/share/man''${MANPATH:+:''${MANPATH}}:"
21+
export INFOPATH="/opt/homebrew/share/info:''${INFOPATH:-}"
22+
'';
23+
1224
home.sessionPath = [
1325
"$HOME/bin"
1426
"$HOME/.local/bin"
@@ -21,6 +33,7 @@
2133
GH_PAGER = "less -RFX";
2234
PAGER = "less -RFX";
2335
PINACT_KEYRING_ENABLED = "true";
24-
HOMEBREW_FORBIDDEN_FORMULAE = "node npm pnpm yarn bun deno go awscli bat chezmoi direnv eza fastfetch fd fzf gh lefthook mise turbo zoxide claude ripgrep";
36+
HOMEBREW_FORBIDDEN_FORMULAE = "node npm pnpm yarn bun deno go awscli bat chezmoi direnv eza fastfetch fd fzf gh lefthook mise starship turbo zoxide claude ripgrep";
37+
ZENO_HOME = "$HOME/.config/zeno";
2538
};
2639
}

home/shell/direnv.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
{
33
programs.direnv = {
44
enable = true;
5-
enableFishIntegration = true;
6-
enableZshIntegration = false;
5+
enableZshIntegration = false; # handled via cache_eval + zsh-defer in zsh.nix
76
nix-direnv.enable = true;
87
};
98

home/shell/fzf.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
programs.fzf = {
44
enable = true;
5-
enableFishIntegration = true;
6-
enableZshIntegration = false;
5+
enableZshIntegration = false; # handled via cache_eval + zsh-defer in zsh.nix
76
};
87
}

0 commit comments

Comments
 (0)