Next: , Previous: , Up: Home Services   [Contents][Index]


11.3.2 Shells

Shells play a quite important role in the environment initialization process, you can configure them manually as described in section Configuring the Shell, but the recommended way is to use home services listed below. It’s both easier and more reliable.

Each home environment instantiates home-shell-profile-service-type, which creates a ~/.profile startup file for all POSIX-compatible shells. This file contains all the necessary steps to properly initialize the environment, but many modern shells like Bash or Zsh prefer their own startup files, that’s why the respective home services (home-bash-service-type and home-zsh-service-type) ensure that ~/.profile is sourced by ~/.bash_profile and ~/.zprofile, respectively.

Shell Profile Service

Available home-shell-profile-configuration fields are:

Path to home-environment symlink, which contains files that have to be sourced or executed by login shell. This path will be set automatically by home-environment.

Defaults to ‘"~/.guix-home"’.

home-shell-profile-configuration parameter: text-config profile

home-shell-profile is instantiated automatically by home-environment, DO NOT create this service manually, it can only be extended.

profile is a list of strings or gexps, which will go to ~/.profile. By default ~/.profile contains the initialization code, which have to be evaluated by login shell to make home-environment’s profile avaliable to the user, but other commands can be added to the file if it is really necessary.

In most cases shell’s configuration files are preferred places for user’s customizations. Extend home-shell-profile service only if you really know what you do.

Defaults to ‘()’.

Bash Home Service

Available home-bash-configuration fields are:

home-bash-configuration parameter: package package

The Bash package to use.

home-bash-configuration parameter: boolean guix-defaults?

Add sane defaults like reading /etc/bashrc, coloring output for ls provided by guix to .bashrc.

Defaults to ‘#t’.

home-bash-configuration parameter: text-config bash-profile

List of strings or gexps, which will be added to .bash_profile. Used for executing user’s commands at start of login shell (In most cases the shell started on tty just after login). .bash_login won’t be ever read, because .bash_profile always present.

Defaults to ‘()’.

home-bash-configuration parameter: text-config bashrc

List of strings or gexps, which will be added to .bashrc. Used for executing user’s commands at start of interactive shell (The shell for interactive usage started by typing bash or by terminal app or any other program).

Defaults to ‘()’.

home-bash-configuration parameter: text-config bash-logout

List of strings or gexps, which will be added to .bash_logout. Used for executing user’s commands at the exit of login shell. It won’t be read in some cases (if the shell terminates by exec’ing another process for example).

Defaults to ‘()’.

Zsh Home Service

Available home-zsh-configuration fields are:

home-zsh-configuration parameter: package package

The Zsh package to use.

home-zsh-configuration parameter: boolean xdg-flavor?

Place all the configs to $XDG_CONFIG_HOME/zsh. Makes ~/.zshenv to set ZDOTDIR to $XDG_CONFIG_HOME/zsh. Shell startup process will continue with $XDG_CONFIG_HOME/zsh/.zshenv.

Defaults to ‘#t’.

home-zsh-configuration parameter: text-config zshenv

List of strings or gexps, which will be added to .zshenv. Used for setting user’s shell environment variables. Must not contain commands assuming the presence of tty or producing output. Will be read always. Will be read before any other file in ZDOTDIR.

Defaults to ‘()’.

home-zsh-configuration parameter: text-config zprofile

List of strings or gexps, which will be added to .zprofile. Used for executing user’s commands at start of login shell (In most cases the shell started on tty just after login). Will be read before .zlogin.

Defaults to ‘()’.

home-zsh-configuration parameter: text-config zshrc

List of strings or gexps, which will be added to .zshrc. Used for executing user’s commands at start of interactive shell (The shell for interactive usage started by typing zsh or by terminal app or any other program).

Defaults to ‘()’.

home-zsh-configuration parameter: text-config zlogin

List of strings or gexps, which will be added to .zlogin. Used for executing user’s commands at the end of starting process of login shell.

Defaults to ‘()’.

home-zsh-configuration parameter: text-config zlogout

List of strings or gexps, which will be added to .zlogout. Used for executing user’s commands at the exit of login shell. It won’t be read in some cases (if the shell terminates by exec’ing another process for example).

Defaults to ‘()’.


Next: , Previous: , Up: Home Services   [Contents][Index]