Set inNixShell#677
Conversation
`nix-shell` passes a `inNixShell = true` argument when evaluating a file, so we should replicate this behaviour. There is another mechanism for signaling that we are in a nix shell, namely the `IN_NIX_SHELL` environment variable (which both nix-shell and nix-direnv also set), but this is by nature not a good solution since it leaks into e.g. further `nix-build` invocations in nix shells. This only concerns non-flake setups, of course.
|
EDIT: nvm the "migitation" - it's actually pointless It did require adjustment in some shell expressions, where Nix can't trivially detect that the "auto-arg" is not accepted. |
|
Limiting this to I guess you're referring to NixOS/nix#5543? That was closed inconclusively; I'll try to replicate the problem there later. |
|
So the problem in NixOS/nix#5543 was that { ... }@args: ({ foo, bar }: qux) argswould be given This PR adds Come to think of it, since nix-direnv calls |
|
I have to give this some thought and investigate the linked context before I make a call. Based on what I am seeing so far though, I think I agree that We are just coming up for air after a pretty hectic weekend of winter storms here - sorry for not getting back to you faster. |
nix-shellpasses ainNixShell = trueargument when evaluating a file, so we should replicate this behaviour. There is another mechanism for signaling that we are in a nix shell, namely theIN_NIX_SHELLenvironment variable (which both nix-shell and nix-direnv also set), but this is by nature not a good solution since it leaks into e.g. furthernix-buildinvocations in nix shells.This only concerns non-flake setups, of course.
ping @roberth @sternenseemann