Command Shell: Difference between revisions

imported>Vieta
m typo
imported>Artturin
Link to options search. Remove unnecessary note which is already warned about in nix code.
Line 9: Line 9:


== Changing default shell ==
== Changing default shell ==
Shells can be changed system-wide and per-user. To change the shell system-wide, add the following line to your config:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
users.defaultUserShell = pkgs.zsh;
</nowiki>}}
then run {{ic|nixos-rebuild switch}} and reboot your system.


To only change the default shell for one of the users, add
[https://search.nixos.org/options?query=defaultUserShell <code>defaultUserShell</code> in the options search]
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
users.users.yourname.shell = pkgs.zsh;
</nowiki>}}


Many programs look at /etc/shells to determine if a user is a "normal" user and not a "system" user. Therefore it is recommended to add the user shells to this list. To add a shell to /etc/shells use the following line in your config:
[https://search.nixos.org/options?query=useDefaultShell <code>useDefaultShell</code> in the options search]
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
 
environment.shells = with pkgs; [ zsh ];
To only change the default shell for one of the users, See
</nowiki>}}
 
[https://search.nixos.org/options?query=<name>.shell <code><name>.shell</code> in the options search]


== Changing /bin/sh ==
== Changing /bin/sh ==