nixpkgs/nixos/doc/manual/release-notes
Lin Jian 8e2e741ab5
zsh: set environment variables in zshenv instead of zprofile
This patch fixes two issues:

1. The file in which environment variables are set is inconsistent.
  - This file sets them in zprofile when programs.zsh.enable is not
  set.
  - Zsh module sets them in zshenv when programs.zsh.enable is set.

2. Setting environment variables in zprofile overrides what users set
in .zshenv.  See these[1] home-manager[2] issues[3].

/etc/profile is also changed to /etc/set-environment. Here is a
comparison:

Using /etc/profile:
- Pros
  - config.environment.shellInit is sourced in all zsh
- Cons
  - config.environment.loginShellInit is also sourced in non-login zsh
  - config.programs.bash.shellInit is also sourced in all zsh
  - config.programs.bash.loginShellInit is also sourced in all zsh

Using /etc/set-environment:
- Pros
  - config.programs.bash.shellInit is not sourced in any zsh
  - config.programs.bash.loginShellInit is not sourced in any zsh
- Cons
  - config.environment.shellInit is not sourced in any zsh
  - config.environment.loginShellInit is not sourced in any zsh

[1]: https://github.com/nix-community/home-manager/issues/2751#issuecomment-1048682643
[2]: https://github.com/nix-community/home-manager/issues/2991
[3]: https://github.com/nix-community/home-manager/issues/3681#issuecomment-1436054233
2023-03-13 17:25:04 +08:00
..
release-notes.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
rl-1310.section.md
rl-1404.section.md
rl-1412.section.md
rl-1509.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-1603.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-1609.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-1703.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-1709.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-1803.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-1809.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-1903.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-1909.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-2003.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-2009.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-2105.section.md doc,nixos/doc: unescape double quotes 2022-12-27 17:13:49 +01:00
rl-2111.section.md doc,nixos/doc: unescape apostrophes 2022-12-27 17:13:47 +01:00
rl-2205.section.md .editorconfig: apply trailing whitespace removal 2022-12-29 01:40:50 +01:00
rl-2211.section.md nixos: fix typos 2022-12-17 19:31:14 -05:00
rl-2305.section.md zsh: set environment variables in zshenv instead of zprofile 2023-03-13 17:25:04 +08:00