Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Commits on Aug 20, 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
    (NixOS#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 committed Aug 20, 2018
    Configuration menu
    Copy the full SHA
    fa67ca1 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2018

  1. nix-daemon: only add channels dir to NIX_PATH if exists

    Per reviewer comment (thanks!).
    dtzWill committed Sep 28, 2018
    Configuration menu
    Copy the full SHA
    68f3081 View commit details
    Browse the repository at this point in the history