Files
lix/lix/libexpr/builtins/getEnv.md
T
eldritch horrorsandjade b0d7a81613 fix tooling after include reorganization
clangd broke because it can't look through symlinks. compile_commands
manipulation does not fix it, clangd configuration does not fix it, a
vfs overlay does not fix it, and while a combination of those can fix
it with a bind mount in place that's just too cursed to even consider

clangd bug: https://github.com/llvm/llvm-project/issues/116877

Change-Id: I8e3e8489548eb3a7aa65ac9d12a5ec8abf814aec
2024-11-19 22:55:32 +00:00

627 B

name, args
name args
getEnv
s

getEnv returns the value of the environment variable s, or an empty string if the variable doesn't exist. This function should be used with care, as it can introduce all sorts of nasty environment dependencies in your Nix expression.

getEnv is used in nixpkgs for evil impurities such as locating the file ~/.config/nixpkgs/config.nix which contains user-local settings for nixpkgs. (That is, it does a getEnv "HOME" to locate the user's home directory.)

When in pure evaluation mode, this function always returns an empty string.