diff --git a/etc/profile.sh b/etc/profile.sh index 2aed1f949f4..30fc8217fdf 100644 --- a/etc/profile.sh +++ b/etc/profile.sh @@ -1,5 +1,5 @@ export PATH=@wrapperDir@:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin -export LD_LIBRARY_PATH=@nssModulesPath@ +export LD_LIBRARY_PATH=@nssModulesPath@:/var/run/current-system/sw/lib export MODULE_DIR=@modulesTree@/lib/modules export NIXPKGS_CONFIG=/nix/etc/config.nix export PAGER="less -R" diff --git a/system/options.nix b/system/options.nix index 3f5605862fb..f62bcd82d8d 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2321,10 +2321,10 @@ root ALL=(ALL) SETENV: ALL environment = { pathsToLink = mkOption { - default = ["/bin" "/sbin" "/share" "/man" "/info"]; + default = ["/bin" "/sbin" "/lib" "/share" "/man" "/info"]; example = ["/"]; description = " - This allows to symlink more directories in /var/run/current-system/sw + Lists directories to be symlinked in `/var/run/current-system/sw'. "; }; diff --git a/system/system.nix b/system/system.nix index 45175ff5701..9d733d804d0 100644 --- a/system/system.nix +++ b/system/system.nix @@ -259,12 +259,16 @@ rec { ++ pkgs.lib.optional config.security.sudo.enable pkgs.sudo ++ pkgs.lib.optional config.services.bitlbee.enable pkgs.bitlbee ++ pkgs.lib.optional config.services.avahi.enable pkgs.avahi - ++ pkgs.lib.optional config.services.avahi.nssmdns pkgs.nssmdns ++ pkgs.lib.optional config.networking.defaultMailServer.directDelivery pkgs.ssmtp ++ pkgs.lib.concatLists (map (job: job.extraPath) upstartJobs.jobs) ++ config.environment.extraPackages pkgs - ++ pkgs.lib.optional config.fonts.enableFontDir fontDir; + ++ pkgs.lib.optional config.fonts.enableFontDir fontDir + # NSS modules need to be in `systemPath' so that (i) the builder + # chroot gets to seem them, and (ii) applications can benefit from + # changes in the list of NSS modules at run-time, without requiring + # a reboot. + ++ nssModules; # We don't want to put all of `startPath' and `path' in $PATH, since # then we get an embarrassingly long $PATH. So use the user @@ -273,7 +277,11 @@ rec { systemPath = pkgs.buildEnv { name = "system-path"; paths = systemPathList; + + # Note: We need `/lib' to be among `pathsToLink' for NSS modules + # to work. inherit (config.environment) pathsToLink; + ignoreCollisions = true; };