-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bugcliThe old and/or new command line interfaceThe old and/or new command line interfacemacosNix on macOS, aka OS X, aka darwinNix on macOS, aka OS X, aka darwinnew-cliRelating to the "nix" commandRelating to the "nix" command
Description
Describe the bug
initNix() clears an environment variable. It shouldn't.
Steps To Reproduce
$ echo TMPDIR=$TMPDIR; nix run nixpkgs#bash -- -c 'echo TMPDIR=$TMPDIR' ~
TMPDIR=/var/folders/vh/whk9gn015sd7vkh2php03jf80000gn/T/
TMPDIR=Expected behavior
Darwin:
$ echo TMPDIR=$TMPDIR; nix run nixpkgs#bash -- -c 'echo TMPDIR=$TMPDIR' ~
TMPDIR=/var/folders/vh/whk9gn015sd7vkh2php03jf80000gn/T/
TMPDIR=/var/folders/vh/whk9gn015sd7vkh2php03jf80000gn/T/Linux (already works, but the variable isn't even set in my session NixOS):
$ (export TMPDIR=/tmp; echo TMPDIR=$TMPDIR; nix run nixpkgs#bash -- -c 'echo TMPDIR=$TMPDIR')
TMPDIR=/tmp
TMPDIR=/tmpnix-env --version output
Additional context
Potential duplicate of #395, although the solution hinted here does not have as broad a scope.
Found while working on a PR to be linked below.
Priorities
Add 👍 to issues you find important.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugcliThe old and/or new command line interfaceThe old and/or new command line interfacemacosNix on macOS, aka OS X, aka darwinNix on macOS, aka OS X, aka darwinnew-cliRelating to the "nix" commandRelating to the "nix" command