home.sessionVariables

Home-Manager option

lazy attribute set of (null or string or absolute path or signed integer or floating point number or boolean)

Environment variables to always set at login. The values may refer to other environment variables using POSIX.2 style variable references. For example, a variable parameter may be referenced as $parameter or $. A default value foo may be given as per ${parameter:-foo} and, similarly, an alternate value bar can be given as per ${parameter:+bar}. Note, these variables may be set in any order so no session variable may have a runtime dependency on another session variable. In particular code like home.sessionVariables = { FOO = "Hello"; BAR = "$FOO World!"; }; may not work as expected. If you need to reference another session variable (even if it is declared by using other options like xdg.configHome), then do so inside Nix instead. The above example then becomes home.sessionVariables = { FOO = "Hello"; BAR = "${config.home.sessionVariables.FOO} World!"; }; Setting a value to null will skip setting the variable at all, which may be useful when overriding.

type: lazy attribute set of (null or string or absolute path or signed integer or floating point number or boolean)
Default
{ }
Example
{ EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; }
declared in: <home-manager/modules/home-environment.nix>source unavailable