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


11.2 Configuring the Shell

This section is safe to skip if your shell or shells are managed by Guix Home. Otherwise, read it carefully.

There are a few scripts that must be evaluated by a login shell to activate the home environment. The shell startup files only read by login shells often have profile suffix. For more information about login shells see Invoking Bash in The GNU Bash Reference Manual and see Bash Startup Files in The GNU Bash Reference Manual.

The first script that needs to be sourced is setup-environment, which sets all the necessary environment variables (including variables declared by the user) and the second one is on-first-login, which starts Shepherd for the current user and performs actions declared by other home services that extends home-run-on-first-login-service-type.

Guix Home will always create ~/.profile, which contains the following lines:

HOME_ENVIRONMENT=$HOME/.guix-home
. $HOME_ENVIRONMENT/setup-environment
$HOME_ENVIRONMENT/on-first-login

This makes POSIX compliant login shells activate the home environment. However, in most cases this file won’t be read by most modern shells, because they are run in non POSIX mode by default and have their own *profile startup files. For example Bash will prefer ~/.bash_profile in case it exists and only if it doesn’t will it fallback to ~/.profile. Zsh (if no additional options are specified) will ignore ~/.profile, even if ~/.zprofile doesn’t exist.

To make your shell respect ~/.profile, add . ~/.profile or source ~/profile to the startup file for the login shell. In case of Bash, it is ~/.bash_profile, and in case of Zsh, it is ~/.zprofile.

Примечание: This step is only required if your shell is NOT managed by Guix Home. Otherwise, everything will be done automatically.


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