NixOS
How to configure Zsh and Oh my Zsh in NixOS?
Configure zsh, Oh my zsh, and install additional plugins in NixOS.
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/bashYou can configure zsh and Oh my zsh in NixOS. There are two ways to install and configure zsh and Oh my zsh in NixOS.
- Using
configuration.nixfile - 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…