Skip to content

nix-shell no longer respects NIX_PATH #10246

Open
@SuperSandro2000

Description

Describe the bug

When running NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz command nix-shell --option nix-path "" -p bash I am only greeted with

error:
       … while calling the 'import' builtin
         at «string»:1:18:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (bash) ]; } ""
             |                  ^

       … while realising the context of a path

       … while calling the 'findFile' builtin
         at «string»:1:25:
            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (bash) ]; } ""
             |                         ^

       error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

but command nix-shell --option nix-path nixpkgs=https://github.com/SuperSandro2000/nixpkgs/archive/nixos-unstable.tar.gz -p bash works as expected

Steps To Reproduce

  1. Run NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz command nix-shell --option nix-path "" -p bash

Expected behavior

It should work as it did with 2.20 or 2.18.

nix-env --version output
nix-env (Nix) 2.21.0

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    bugsettingsSettings, global flags, nix.conf

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions