feat: zsh default shell + starship/bat/eza/zoxide shell experience

zsh is now the default login shell (programs.zsh.enable +
users.defaultUserShell, mkOverride 500 to beat bash.nix's mkDefault;
per-user shell= still overrides). modules/home/shell.nix configures the
interactive experience (nomarchy.shell.enable):

- zsh: completion, autosuggestions, syntax highlighting, big shared
  history, autocd.
- starship prompt themed from the palette (a `nomarchy` palette built
  from theme-state.json colors).
- bat as cat (theme "ansi" → tracks the terminal/theme palette), eza as
  ls (icons + git + dirs-first), zoxide as cd (--cmd cd).
- rg/fd shipped as themselves — deliberately NOT aliased over grep/find
  (flag differences surprise).

home.shell.enableZshIntegration = true is the single lever; starship,
eza, zoxide, ghostty and yazi all emit their zsh hooks from it (no
per-module edits). Verified: flake check green, default shell resolves
to zsh, .zshrc carries the starship/zoxide/eza/yazi hooks + aliases,
starship palette renders, all tools in the live ISO closure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-06-13 16:25:21 +01:00
parent f97054c804
commit df7c0ef7ae
5 changed files with 136 additions and 5 deletions

View File

@@ -61,7 +61,8 @@ Flat on purpose. Two module trees, one options file each, no hidden layers.
│ ├── swaync.nix # notifications, same JSON │ ├── swaync.nix # notifications, same JSON
│ ├── idle.nix # hyprlock + hypridle, same JSON │ ├── idle.nix # hyprlock + hypridle, same JSON
│ ├── yazi.nix # flagship TUI file manager + plugins │ ├── yazi.nix # flagship TUI file manager + plugins
── osd.nix # swayosd volume/brightness OSD ── osd.nix # swayosd volume/brightness OSD
│ └── shell.nix # zsh + starship + bat/eza/zoxide
├── hosts/ ├── hosts/
│ ├── default/ # reference machine (thin: boot, user, hostname) │ ├── default/ # reference machine (thin: boot, user, hostname)
│ └── live.nix # bootable live ISO (try the distro, no install) │ └── live.nix # bootable live ISO (try the distro, no install)
@@ -178,6 +179,7 @@ examples: **[docs/OVERRIDES.md](docs/OVERRIDES.md)**.
| `nomarchy.idle.enable` | `true` | hyprlock + hypridle (idle lock 5 min, display off 10, suspend 30) | | `nomarchy.idle.enable` | `true` | hyprlock + hypridle (idle lock 5 min, display off 10, suspend 30) |
| `nomarchy.yazi.enable` | `true` | yazi TUI file manager, themed + curated plugins | | `nomarchy.yazi.enable` | `true` | yazi TUI file manager, themed + curated plugins |
| `nomarchy.osd.enable` | `true` | swayosd on-screen display for volume/brightness/mute | | `nomarchy.osd.enable` | `true` | swayosd on-screen display for volume/brightness/mute |
| `nomarchy.shell.enable` | `true` | zsh + starship prompt + bat/eza/zoxide (zsh is the default login shell) |
| `nomarchy.ghostty.enable` | `true` | Nomarchy's Ghostty | | `nomarchy.ghostty.enable` | `true` | Nomarchy's Ghostty |
| `nomarchy.btop.enable` | `true` | btop with per-theme colors | | `nomarchy.btop.enable` | `true` | btop with per-theme colors |
| `nomarchy.stylix.enable` | `true` | GTK/Qt/cursor theming | | `nomarchy.stylix.enable` | `true` | GTK/Qt/cursor theming |
@@ -322,10 +324,12 @@ close · `SUPER+1..9` workspaces · `Print` region screenshot.
Papirus-Dark/Light by `mode`) and feeds both Stylix's `gtk.iconTheme` Papirus-Dark/Light by `mode`) and feeds both Stylix's `gtk.iconTheme`
(Thunar/GTK apps) and rofi's `show-icons`. Remaining (optional): per-theme (Thunar/GTK apps) and rofi's `show-icons`. Remaining (optional): per-theme
`icons` overrides for the presets, or shipping more icon packs. `icons` overrides for the presets, or shipping more icon packs.
- **Nicer shell out of the box:** ship and default-configure a prompt - **Nicer shell out of the box:** ✓ zsh is the default login shell, with a
(starship, themed from the JSON) plus modern-CLI ergonomics — starship prompt themed from the JSON, autosuggestions + syntax
`bat`→cat, `eza`→ls, `ripgrep`→grep, `fd`→find, `zoxide`→cd — wired as highlighting, and modern-CLI ergonomics — `cat`→bat (theme "ansi", so it
aliases/`$PAGER` so the terminal is pleasant by default (overridable). tracks the palette), `ls`→eza, `cd`→zoxide, plus `lt`/`tree`.
`nomarchy.shell.enable`. (Deliberately did NOT alias grep→rg / find→fd:
their flags differ enough to surprise; `rg`/`fd` ship as themselves.)
- **Default application suite:** install a complete-workstation set - **Default application suite:** install a complete-workstation set
(vscode, libreoffice, gimp, inkscape, texlive-full, …) behind a (vscode, libreoffice, gimp, inkscape, texlive-full, …) behind a
`nomarchy.apps.*` option surface so each is individually opt-out for `nomarchy.apps.*` option surface so each is individually opt-out for

View File

@@ -17,6 +17,7 @@
./idle.nix # hyprlock + hypridle, themed from the same JSON ./idle.nix # hyprlock + hypridle, themed from the same JSON
./yazi.nix # flagship TUI file manager, themed + plugins ./yazi.nix # flagship TUI file manager, themed + plugins
./osd.nix # swayosd volume/brightness OSD, themed ./osd.nix # swayosd volume/brightness OSD, themed
./shell.nix # zsh + starship + bat/eza/zoxide, themed
]; ];
# Clipboard history (wl-paste watcher); browsed via the SUPER+CTRL+V # Clipboard history (wl-paste watcher); browsed via the SUPER+CTRL+V

View File

@@ -68,6 +68,7 @@
idle.enable = lib.mkEnableOption "hyprlock + hypridle (idle lock, display off, suspend)" // { default = true; }; idle.enable = lib.mkEnableOption "hyprlock + hypridle (idle lock, display off, suspend)" // { default = true; };
yazi.enable = lib.mkEnableOption "the yazi TUI file manager, themed with a curated plugin set" // { default = true; }; yazi.enable = lib.mkEnableOption "the yazi TUI file manager, themed with a curated plugin set" // { default = true; };
osd.enable = lib.mkEnableOption "swayosd on-screen display for volume/brightness/mute" // { default = true; }; osd.enable = lib.mkEnableOption "swayosd on-screen display for volume/brightness/mute" // { default = true; };
shell.enable = lib.mkEnableOption "the zsh shell experience (starship prompt, bat/eza/zoxide)" // { default = true; };
ghostty.enable = lib.mkEnableOption "Nomarchy's Ghostty configuration" // { default = true; }; ghostty.enable = lib.mkEnableOption "Nomarchy's Ghostty configuration" // { default = true; };
btop.enable = lib.mkEnableOption "btop with the per-theme nomarchy theme" // { default = true; }; btop.enable = lib.mkEnableOption "btop with the per-theme nomarchy theme" // { default = true; };
stylix.enable = lib.mkEnableOption "Stylix theming for the long tail of apps (GTK, Qt, cursors)" // { default = true; }; stylix.enable = lib.mkEnableOption "Stylix theming for the long tail of apps (GTK, Qt, cursors)" // { default = true; };

114
modules/home/shell.nix Normal file
View File

@@ -0,0 +1,114 @@
# Shell experience — zsh (the default login shell, set system-side) with
# autosuggestions + syntax highlighting, a themed starship prompt, and
# modern CLI tools wired in: bat (cat), eza (ls), zoxide (cd). bat uses
# the "ansi" theme so it follows the terminal palette (Ghostty is themed
# from the same JSON); starship is themed from the palette directly.
#
# home.shell.enableZshIntegration = true is the single lever that makes
# every integrating program (starship, eza, zoxide, ghostty, yazi) emit
# its zsh hooks — no per-module flags needed.
{ config, lib, pkgs, ... }:
let
cfg = config.nomarchy;
t = cfg.theme;
c = t.colors;
in
{
config = lib.mkIf cfg.shell.enable {
home.shell.enableZshIntegration = true;
# rg/fd as themselves (NOT aliased over grep/find — their flags
# differ enough to surprise). Available regardless of yazi/rofi.
home.packages = with pkgs; [ ripgrep fd ];
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
autocd = true;
history = {
size = 50000;
save = 50000;
ignoreDups = true;
ignoreSpace = true;
expireDuplicatesFirst = true;
};
shellAliases = {
cat = "bat --paging=never";
less = "bat";
grep = "grep --color=auto";
# eza enableZshIntegration aliases ls/ll/la; add a couple extras.
lt = "eza --tree --level=2 --icons=auto --group-directories-first";
tree = "eza --tree --icons=auto --group-directories-first";
".." = "cd ..";
"..." = "cd ../..";
};
};
programs.starship = {
enable = true;
settings = {
add_newline = false;
palette = "nomarchy";
# starship wants full #rrggbb (or names) — keep the leading #.
palettes.nomarchy = {
inherit (c) base text accent good warn bad subtext;
};
format = lib.concatStrings [
"[](accent)"
"$directory"
"$git_branch$git_status"
"$character"
];
directory = {
style = "fg:text bg:accent";
format = "[ $path ]($style)";
truncation_length = 3;
truncate_to_repo = true;
};
git_branch = {
style = "fg:base bg:warn";
format = "[ $symbol$branch ]($style)";
symbol = " ";
};
git_status = {
style = "fg:base bg:warn";
format = "[$all_status$ahead_behind ]($style)";
};
character = {
success_symbol = "[ ](good)";
error_symbol = "[ ](bad)";
};
cmd_duration = {
min_time = 2000;
style = "fg:subtext";
format = "[ $duration ]($style)";
};
};
};
# bat: "ansi" follows the terminal's 16-color palette → tracks the
# active Nomarchy theme (Ghostty bakes it) with no per-theme config.
programs.bat = {
enable = true;
config = {
theme = "ansi";
style = "numbers,changes,header";
};
};
programs.eza = {
enable = true;
icons = "auto";
git = true;
extraOptions = [ "--group-directories-first" ];
};
programs.zoxide = {
enable = true;
options = [ "--cmd cd" ]; # `cd` becomes the smart jumper (z under the hood)
};
};
}

View File

@@ -71,6 +71,17 @@ in
services.upower.enable = lib.mkDefault true; services.upower.enable = lib.mkDefault true;
networking.networkmanager.enable = lib.mkDefault true; networking.networkmanager.enable = lib.mkDefault true;
# zsh as the default login shell (the desktop's shell experience —
# starship/bat/eza/zoxide — is configured home-side in shell.nix).
# programs.zsh.enable wires /etc/zshrc, completion and /etc/shells;
# defaultUserShell applies to normal users that don't set their own.
programs.zsh.enable = lib.mkDefault true;
# mkOverride 500: beats nixpkgs' bash.nix `mkDefault bashInteractive`
# (equal mkDefault priority would conflict) while staying below a
# plain downstream assignment. A per-user `users.users.<n>.shell`
# overrides this regardless.
users.defaultUserShell = lib.mkOverride 500 pkgs.zsh;
hardware.bluetooth.enable = lib.mkDefault cfg.bluetooth.enable; hardware.bluetooth.enable = lib.mkDefault cfg.bluetooth.enable;
services.blueman.enable = lib.mkDefault cfg.bluetooth.enable; services.blueman.enable = lib.mkDefault cfg.bluetooth.enable;