Zsh
What this config does
NixOS sets Zsh as the login shell for user owais. Home Manager enables
completion, autosuggestions, syntax highlighting, Oh My Zsh, and Starship.
Nix location
conf/shared.nix:programs.zsh.enablefor NixOSconf/shared.nix:users.users.owais.shellconf/shared.nix: Home Managerprograms.zsh
Oh My Zsh plugins:
gitz
Portable setup
Install Zsh and make it your login shell:
chsh -s "$(command -v zsh)"
Install Oh My Zsh if your distro does not package it:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Add PATH entries to ~/.zshrc:
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
Initialize Starship:
eval "$(starship init zsh)"
Aliases worth copying
alias ll='ls -l'
alias cat='bat --paging=never --style=plain'
alias less='bat'
alias preview='bat --style=numbers,changes --color=always'
alias zed='zeditor'
alias zedn='zeditor --new'
Do not copy these outside NixOS:
alias rebuild='sudo nixos-rebuild switch --flake ~/Projects/nixos-conf#$(hostname)'
alias switch='sudo nixos-rebuild switch --flake ~/Projects/nixos-conf#$(hostname)'
alias update='sudo nixos-rebuild switch --flake ~/Projects/nixos-conf#$(hostname)'
alias nboot='sudo nixos-rebuild boot --flake ~/Projects/nixos-conf#$(hostname)'
alias tbuild='sudo nixos-rebuild test --flake ~/Projects/nixos-conf#$(hostname)'
Check it
zsh --version
echo "$SHELL"
starship --version
Log out and back in after changing the login shell.