How to change the default shell in NixOS?

At the moment I need to set the fish shell to be my default shell on NixOS and there is no official documentation on how to do that declaratively (not by running chsh) in NixOS.

In your configuration.nix,

{ pkgs, ... }:

{
  ...

  programs.fish.enable = true;

  users.users.<myusername> = {   
    ...  
    shell = pkgs.fish;
    ...
  };
}

Followed by nixos-rebuild switch.

More info in NixOS Wiki.

Answered By: Sridhar Ratnakumar
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.