nixpkgs/nixos
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
..
doc/manual zsh: set environment variables in zshenv instead of zprofile 2023-03-13 17:25:04 +08:00
lib nixos/lib/make-multi-disk-zfs-image: expose memSize parameter 2023-02-26 20:18:04 -05:00
maintainers treewide: fix backwards smart apostrophes 2023-02-06 07:24:42 -05:00
modules Merge pull request #214759 from Tom-Hubrecht/borgmatic 2023-03-04 11:38:39 +01:00
tests nixos/tests/nat: remove conntrack helpers test 2023-03-04 10:53:48 +03:00
COPYING
default.nix
README
release-combined.nix nixos/release-*: finish dropping the conntrack tests 2023-03-04 09:28:09 +01:00
release-small.nix nixos/release-*: finish dropping the conntrack tests 2023-03-04 09:28:09 +01:00
release.nix nixos/manual: clean up default.nix a bit 2023-02-12 11:58:20 +01:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
https://nixos.org/nixos and in the manual in doc/manual.