Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 74df71bc8b44
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: 243e28bc96db
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Sep 30, 2018

  1. NIX_PATH: don't prepend $HOME-based value in session variable, set later

    environment.sessionVariables cannot refer to the values of env vars,
    and as a result this has caused problems in a variety of scenarios.
    
    One use for these is that they're injected into /etc/profile,
    elewhere these are used to populate an 'envfile' for pam
    (`pam 5 pam_env.conf`) which mentions use of HOME being
    potentially problematic.
    
    Anyway if the goal is to make things easier for users,
    simply do the NIX_PATH modification as extraInit.
    
    This fixes the annoying problems generated by the current approach
    (#40165 and others) while hopefully serving the original goal.
    
    One way to check if things are borked is to try:
    
    $ sudo env | grep NIX_PATH
    
    Which (before this change) prints NIX_PATH variable with
    an unexpanded $HOME in the value.
    
    -------
    
    This does mean the following won't contain user channels for 'will':
    $ sudo -u will nix-instantiate --eval -E builtins.nixPath
    
    However AFAICT currently they won't be present either,
    due to unescaped $HOME.  Unsure if similar situation for other users
    of sessionVariables (not sudo) work with current situation
    (if they exist they will regress after this change AFAIK).
    dtzWill authored and grahamc committed Sep 30, 2018
    Copy the full SHA
    f3a114e View commit details
    Browse the repository at this point in the history
  2. nix-daemon: only add channels dir to NIX_PATH if exists

    Per reviewer comment (thanks!).
    dtzWill authored and grahamc committed Sep 30, 2018
    Copy the full SHA
    243e28b View commit details
    Browse the repository at this point in the history