Unfortunately, using `attrsOf` is not possible since it results in too
eager evaluation. In particular, the
home.sessionVariables = {
FOO = "Hello";
BAR = "${config.home.sessionVariables.FOO} World!";
};
example will cause an infinite recursion.
This commit restores the option type of
- `home.sessionVariables`,
- `pam.sessionVariables`,
- `programs.bash.sessionVariables`, and
- `programs.zsh.sessionVariables`
to `attrs`. It also adds test cases for the above options to avoid
regressions.
Fixes#659
Add option "extraLocalVars" for additional local variable definitions
in .zshrc, at the top of the file.
Some zsh plugins/themes expect configuration in local variables before they
are loaded (example: https://github.com/bhilburn/powerlevel9k). Exporting
those clutters the environment and is unnecessary.
Use the new module lib.zsh to generate export statements in zsh syntax, using
zsh arrays for lists.
Being a zsh script, this seems more intuitive for .zshrc
Forcing fpath to contain unique values increases startup speed by
eliminating extra work of processing duplicated folders.
In addition, it increases startup time when zsh is enabled in both
system and home configuration due to having the same fpath value
between different compinit calls.
Fixes https://github.com/rycee/home-manager/issues/108.
Same motivation as in https://github.com/NixOS/nixpkgs/pull/28378.
zsh.initExtra parameter can be used by external modules which can
redefine user aliases. This change will give user-defined aliases
the highest priority.
1. It slows down the initial start: it takes around 2s at first launch,
and around 0.25s for the following launches;
2. It seems to be redundant since just installing zsh package gives
working completions with correct $fpath set.