-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Describe the bug
Running nix-shell or nix develop or nix shell as root drops you into / instead of staying in the current directory.
Steps To Reproduce
nix shell example
sudo nix shell nixpkgs#hellonix-shell example
# shell.nix
with import <nixpkgs> {};
mkShell {}sudo nix-shellnix develop example
# flake.nix
{
outputs = { nixpkgs, ... }: {
devShell.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.mkShell {};
};
}sudo nix developExpected behavior
Drops you into a shell in the current directory.
Additional context
nix (Nix) 2.7.0pre20220210_5b809f9
First noticed on 52f5231.
We worked around it for now using env -C "$PWD".
Reactions are currently unavailable