Command Shell: Difference between revisions
m hyperlink shell, fish, and nushell |
added a small paragraph about shell aliasing |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 39: | Line 39: | ||
users.users.myuser.useDefaultShell = true; | users.users.myuser.useDefaultShell = true; | ||
</nowiki>}} | </nowiki>}} | ||
== Aliases == | |||
You can set aliases for all shells via: | |||
{{File|3=environment.shellAliases = { | |||
rebuild = "sudo nixos-rebuild switch --flake /etc/nixos/#nixos"; | |||
};|name=/etc/nixos/configuration.nix|lang=nix}} | |||
== Using a different shell in nix-shell and nix develop == | == Using a different shell in nix-shell and nix develop == | ||
| Line 75: | Line 81: | ||
* Nested shells will require you to type <code>exit</code> twice, once to leave the inner shell and once to exit the Nix shell environment itself. | * Nested shells will require you to type <code>exit</code> twice, once to leave the inner shell and once to exit the Nix shell environment itself. | ||
* Potential for alias conflicts as overriding commands can introduce unintended side effects in scripts or other tooling that expects the standard behavior. | * Potential for alias conflicts as overriding commands can introduce unintended side effects in scripts or other tooling that expects the standard behavior. | ||
== Using Flakes == | |||
If you are using [[Flakes]] with fish, the 'command-not-found' error message will not work correctly, but can be fixed by disabling the builtin Nix <code>command-not-found</code> program:<ref>https://github.com/NixOS/nixpkgs/issues/425613#issuecomment-3076081921</ref> | |||
{{File|3=programs.command-not-found.enable = false;|name=/etc/nixos/configuration.nix|lang=nix}} | |||
== See also == | == See also == | ||
| Line 80: | Line 90: | ||
* [[Nushell]] | * [[Nushell]] | ||
* [[Zsh]] | * [[Zsh]] | ||
* [[Flakes]] | |||
== References == | |||
[[Category:Configuration]] | [[Category:Configuration]] | ||
[[Category:Software]] | [[Category:Software]] | ||
[[Category:Shell]] | [[Category:Shell]] | ||