Jump to content

Bash: Difference between revisions

From Official NixOS Wiki
Pigs (talk | contribs)
Create bash page with information on configuration options
 
DHCP (talk | contribs)
 
(One intermediate revision by one other user not shown)
Line 13: Line 13:
{{file|/etc/nixos/configuration.nix|nix|
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
<nowiki>
  programs.bash = {
programs.bash = {
    shellAliases = {
  shellAliases = {
      ll = "ls -l";
    ll = "ls -l";
      rebuild = "sudo nixos-rebuild switch";
    rebuild = "sudo nixos-rebuild switch";
    };
   };
   };
};
</nowiki>
</nowiki>
}}
}}
Line 27: Line 27:


Bash can also be configured by [[Home Manager]]. Module options can be looked up at the [https://home-manager-options.extranix.com/?query=programs.bash&release=master Home Manager Option Search]
Bash can also be configured by [[Home Manager]]. Module options can be looked up at the [https://home-manager-options.extranix.com/?query=programs.bash&release=master Home Manager Option Search]
== See also ==
* [[Command Shell]]
[[Category:Shell]]

Latest revision as of 07:06, 16 July 2026

Bash (Bourne Again SHell) is the default command-line shell on many Linux systems, including NixOS.

Installation

Bash is included and enabled by default in NixOS.

Configuration

NixOS System Configuration

Bash can be configured system-wide using the programs.bash module in your configuration.nix. Below is an example configuration:

❄︎ /etc/nixos/configuration.nix
programs.bash = {
  shellAliases = {
    ll = "ls -l";
    rebuild = "sudo nixos-rebuild switch";
  };
};

For a complete list of available options, see programs.bash.

Home Manager

Bash can also be configured by Home Manager. Module options can be looked up at the Home Manager Option Search

See also