Skip to content

Zsh ​

Catalog v8.

Makes Zsh the VM user's login shell and configures Oh My Zsh, command completion, a prompt, searchable local history, directory navigation, and project environments.

Select ​

The terminal shell preset includes Zsh, and prompt chooses its prompt:

toml
[shell]
preset = "terminal"
prompt = "pure" # pure, starship or none

Apply the change after editing limanix.toml. The next limanix shell uses Zsh. A fresh home opens the configured shell directly without the automatic first-login setup wizard. The module does not create or edit personal .zshenv, .zprofile, .zshrc or .zlogin files. Personal startup files, ZDOTDIR and an existing new-user setup handler retain their normal behavior.

Versions ​

Oh My Zsh and the other tools come from the catalog's base Nixpkgs revision. This module has no version lines. Inside the VM, zsh --version shows the shell version.

Use ​

ToolBehavior inside the VM
Oh My ZshLoads the shell framework; the chosen prompt replaces its themes
PromptPure by default: directory, Git state, command duration and a failed command's color; Starship with prompt = "starship" adds the hostname, detected language versions and the exit status
Zsh autosuggestionsSuggests commands from shell history; press Right to accept
Zsh syntax highlightingHighlights commands as you type
fzf-tab and CarapacePress Tab to search completion candidates
fzfCtrl-T inserts selected paths; Alt-C changes directory; Ctrl-R remains assigned to Atuin
AtuinPress Ctrl-R to search recorded commands; Up retains shell history navigation
zoxideAfter visiting directories, use z project or zi to find them again
direnv and nix-direnvLoads an approved project environment when you enter its directory

The VM platform supplies Ghostty's terminal description for connections with TERM=xterm-ghostty. The Carapace initialization script is generated during the Nix build and sourced when Zsh starts.

Atuin records history in the VM user's data directory, normally ~/.local/share/atuin/history.db. Automatic synchronization and update checks are disabled; no account is needed. Its managed settings are in /etc/atuin/config.toml.

For a project that already has an .envrc, inspect that file and run this inside the project directory in the VM:

console
direnv allow

Direnv requires approval again when .envrc changes. For Nix projects, nix-direnv provides cached use flake and use nix environments. This module does not create an environment definition for the project.

Prompt ​

Both managed prompts use the colors of the guest's theme. With the default system flavor they are the terminal's own colors. The prompt follows the theme of the terminal on your Mac. A Catppuccin flavor in [theme] of limanix.toml uses its palette instead. Outside tmux, both show the words of lmx status --short that need attention, such as restart; inside tmux, tmux's status line shows them.

promptBehavior
purePure on two lines. Its colors are zstyle ':prompt:pure:*' color settings; a terminal without 24-bit color gets the nearest of 256 colors. The lmx words appear in the right prompt
starshipStarship with the theme's palette, the hostname and the exit status. A personal ~/.config/starship.toml takes precedence; managed settings accept ordinary programs.starship.settings assignments, including the lmx segment, custom.lmx
noneNo managed prompt: set PROMPT in your ~/.zshrc

With Pure, change a color or the right prompt in ~/.zshrc, which Zsh reads after the managed startup:

zsh
zstyle ':prompt:pure:path' color cyan
RPROMPT='%*'   # replaces the lmx words with the time

Customize ​

Add personal shell settings to ~/.zshrc inside the VM. To change managed settings, use a custom NixOS module. For example, enable Oh My Zsh's Git aliases:

nix
{ ... }:
{
  programs.zsh.ohMyZsh.plugins = [ "git" ];
}

The module's public setting lmx.zsh.prompt takes the values of prompt. An ordinary programs.zsh.promptInit assignment replaces the managed Pure or empty prompt initialization.

Zsh is the suggested login shell. To keep the Zsh tools while choosing a different login shell, set limanix.user.shell in a custom module. For example:

nix
{ pkgs, ... }:
{
  limanix.user.shell = pkgs.bashInteractive;
}

With multiplexer = "tmux", the tmux module adds persistent terminal sessions.

Configuration and integration
BoundaryContract
Public settingslmx.zsh.prompt: pure, starship or none; limanix.user.shell accepts a different login shell
Standard settingsprograms.zsh.*, programs.starship.settings, programs.atuin.* and the tools' NixOS options
Personal state~/.zshrc, native XDG configuration, Atuin history and project direnv state
IntegrationSupplies shell hooks; Yazi adds its directory handoff independently
Services and capabilitiesNo language-support provider declarations; Atuin synchronization defaults off

Corner cases ​

CaseBehavior or next step
Project environment is blockedInspect .envrc and run direnv allow in the guest
History is not shared with the MacAtuin uses guest-local state and does not sync by default
Different login shellZsh integrations apply when you run Zsh; changing the login shell does not remove its packages
Pristine homeThe managed shell starts without creating ~/.zshrc or opening the setup wizard
Custom startup directoryZsh reads personal startup files from ZDOTDIR when set
You want the setup wizardThe normal zsh-newuser-install function remains available for explicit manual use
Colors look wrong with PureWith a Catppuccin flavor, set COLORTERM=truecolor when the terminal supports 24-bit color, or choose colors from its 256-color palette with zstyle; the system flavor needs neither

Free and open source under the Apache License 2.0.