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.
Asked
Active
Viewed 1.3k times
21
Sridhar Ratnakumar
- 883
- 1
- 7
- 17
1 Answers
33
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.
Sridhar Ratnakumar
- 883
- 1
- 7
- 17
-
1How do you make fish default for all users? – George Shalvashvili Feb 01 '22 at 18:26
-
1`users.defaultUserShell = pkgs.fish;` [Docs](https://nixos.wiki/wiki/Command_Shell#Changing_default_shell) – TeNNoX Mar 18 '22 at 14:10
-
Is there a way to do this in the `home-server` user configuration using flakes? – Martin Braun Jul 18 '23 at 07:32