22

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.

1 Answer 1

34

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.

3
  • 1
    How do you make fish default for all users? Commented Feb 1, 2022 at 18:26
  • 1
    users.defaultUserShell = pkgs.fish; Docs
    – TeNNoX
    Commented Mar 18, 2022 at 14:10
  • Is there a way to do this in the home-server user configuration using flakes? Commented Jul 18, 2023 at 7:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .