nix-super/src
Rodney Lorrimar e1131b5927
print-dev-env: Avoid using unbound shellHook variable
Some tools which consume the "nix print-dev-env" rc script (such as
"nix-direnv") are sensitive to the use of unbound variables. They use
"set -u".

The "nix print-dev-env" rc script initially unsets "shellHook", then
loads variables from the derivation, and then evaluates "shellHook".
However, most derivations don't have a "shellHook" attribute.

So users get the error "shellHook: unbound variable". This can be
demonstrated with the command:

    nix print-dev-env nixpkgs#hello | bash -u

This commit changes the rc script to provide an empty fallback value
for the "shellHook" variable.

Closes: #7951 #8253
2024-02-04 13:57:13 +08:00
..
build-remote Factor out Machine::systemSupported 2024-01-23 12:53:51 -05:00
libcmd Print positions in --debugger, instead of pointers 2024-02-02 17:38:46 -08:00
libexpr Change an allowPath call to take a store path again 2024-01-31 11:44:06 -05:00
libfetchers fetchTree/fetchGit: re-enable shallow fetching 2024-01-19 20:30:47 +07:00
libmain Use buildprefix in a few more places 2023-11-29 19:49:07 -05:00
libstore builtin:fetchurl: Get output hash info from the drv 2024-02-01 22:01:02 +01:00
libutil Fix formatting of hash args 2024-01-29 17:50:25 +01:00
nix print-dev-env: Avoid using unbound shellHook variable 2024-02-04 13:57:13 +08:00
nix-build DerivationInfo -> PackageInfo 2024-01-16 15:28:03 +01:00
nix-channel Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-collect-garbage Split up util.{hh,cc} 2023-11-05 12:20:02 -05:00
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env DerivationInfo -> PackageInfo 2024-01-16 15:28:03 +01:00
nix-instantiate DerivationInfo -> PackageInfo 2024-01-16 15:28:03 +01:00
nix-store Factor our ServeProto::BasicServerConnection::handshake 2024-01-22 12:43:11 -05:00
resolve-system-dependencies Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00