How do you configure Zsh and Oh my Zsh in NixOS?

NixOS

How to configure Zsh and Oh my Zsh in NixOS?

Rajdeep Singh
The Linux
Published in
3 min readFeb 8, 2024

Configure zsh and Oh my zsh in NixOS to enhance the developer terminal experience.

NixOS, by default, comes with a bash shell; check the default shell in NixOS with the following command.

$ echo $SHELL
/run/current-system/sw/bin/bash

You can configure zsh and Oh my zsh in NixOS. There are two ways to install and configure zsh and Oh my zsh in NixOS.

  1. Using configuration.nix file
  2. Using the NixOS Home Manager tool

Using configuration.nix file

The configuration.nix is the most common file to install and configure packages.

To install the zsh and oh my zsh in NixOS, copy and paste the following code into the configuration.nix file.

# configuration.nix

# for global user
users.defaultUserShell=pkgs.zsh;

# For a specific user
users.users.<my-username>.shell = pkgs.zsh;
# users.users.officialrajdeepsingh.shell = pkgs.zsh;

# enable zsh and oh my zsh
programs = {
zsh = {
enable = true;
autosuggestions.enable = true;
zsh-autoenv.enable = true

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Rajdeep Singh
The Linux

JavaScript | TypeScript | Reactjs | Nextjs | Rust | Biotechnology | Bioinformatic | Frontend Developer | Author | https://linktr.ee/officialrajdeepsingh