summary refs log tree commit diff
path: root/pkgs/build-support/build-fhs-userenv
diff options
context:
space:
mode:
authorDaniel Fullmer <danielrf12@gmail.com>2022-02-19 15:34:55 -0800
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-02-27 15:59:39 -0800
commit0a8007498f9dba0d5feb191d16317ffa85a9e698 (patch)
tree4219b864f6e62fee2852f4290be922eccca73319 /pkgs/build-support/build-fhs-userenv
parentf4676c4cb05d63a23818d241d3c91be89ed29a83 (diff)
downloadnixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar.gz
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar.bz2
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar.lz
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar.xz
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.tar.zst
nixpkgs-0a8007498f9dba0d5feb191d16317ffa85a9e698.zip
bash: use default PATH in FHS environments
If bash is executed within an environment where PATH is not set, it uses
the DEFAULT_PATH_VALUE compiled into bash to set PATH. In nixpkgs we set
this to /no-such-path by default. This makes sense in a nixpkgs/NixOS
environment since paths like /bin or /usr/bin should not be used.
However, when bash is used inside an FHS environment, this produces
results that differ from distributions which follow the FHS standard.

Before this change:
$ steam-run env -i /bin/bash -c 'echo $PATH'
/no-such-path

After this change:
$ steam-run env -i /bin/bash -c 'echo $PATH'
/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:.
Diffstat (limited to 'pkgs/build-support/build-fhs-userenv')
-rw-r--r--pkgs/build-support/build-fhs-userenv/env.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/build-fhs-userenv/env.nix b/pkgs/build-support/build-fhs-userenv/env.nix
index 44c8adb06e1..abf577baa2d 100644
--- a/pkgs/build-support/build-fhs-userenv/env.nix
+++ b/pkgs/build-support/build-fhs-userenv/env.nix
@@ -45,7 +45,7 @@ let
   basePkgs = with pkgs;
     [ glibcLocales
       (if isMultiBuild then glibc_multi else glibc)
-      (toString gcc.cc.lib) bashInteractive coreutils less shadow su
+      (toString gcc.cc.lib) bashInteractiveFHS coreutils less shadow su
       gawk diffutils findutils gnused gnugrep
       gnutar gzip bzip2 xz
     ];