Command Shell
A shell is a program that translates text commands (like ls, vim, reboot etc) into instructions for your computer. The default shell on NixOS is bash, but it can be easily changed.
Enable
Always enable the shell system-wide, even if it's already enabled in your home.nix. Otherwise it wont source the necessary files.
programs.zsh.enable = true;
Changing default shell
defaultUserShell in the options search
useDefaultShell in the options search
To only change the default shell for one of the users, See
Changing /bin/sh
/bin/sh is a symlink to your default POSIX-Compliant shell. It's used when writing shell scripts, so that the script works on all machines independently of what shell the user is using. /bin/sh doesn't have to be the same as your interactive shell (e.g. the one you use in your terminal). In fact, a lot of people set their interactive shells to zsh/fish, but set /bin/sh to dash, because it's fast and scripts don't need any of those fancy zsh/fish features.
To change your default POSIX shell on NixOS, use
# Dash is just an example, you can use whatever you want
environment.binsh = "${pkgs.dash}/bin/dash";