nixpkgs/nixos/doc/manual
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
..
administration nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
configuration nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
development lib/options: Add more options to mkPackageOption 2023-02-26 03:00:22 +01:00
installation nixos/manual: fix typos in install instructions 2023-02-22 15:40:33 +01:00
manpages nixos/doc: don't prescribe OS / manual name 2023-02-23 20:53:04 +01:00
release-notes zsh: set environment variables in zshenv instead of zprofile 2023-03-13 17:25:04 +08:00
contributing-to-this-manual.chapter.md nixos/manual: remove md-to-db 2023-02-10 06:40:15 +01:00
default.nix nixos-render-docs: use multiprocessing for options 2023-02-18 13:17:57 +01:00
man-pages.xml nixos/manual: inline man-configuration.xml 2023-02-12 11:55:10 +01:00
manual.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
nixos-options.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
preface.md nixos-render-docs: add structural includes, use for manual 2023-02-12 13:02:42 +01:00
README.md