Nix-shell error - called with unexpected argument 'inNixShell'

I tried the following command that I cut and pasted from Nix package versions
nix-shell -p vim -I nixpkgs=
Got an error stating:
error: anonymous function at /nix/store/ywx43q2cb5yyb88z79c7rfi95hwpcgki-source/pkgs/top-level/default.nix:20:1 called with unexpected argument ‘inNixShell’

   at /nix/store/ywx43q2cb5yyb88z79c7rfi95hwpcgki-source/pkgs/top-level/impure.nix:82:1:

       82| import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
         | ^
       83|   inherit config overlays crossSystem;

Help appreciated

From a bit of googling, it seems you stumbled across a known backwards compatibility breakage. There was an attempted fix in but that was never completed.

Also from that thread, the only way to fix it is to use a version of Nix <= 2.3. Based on the specifics of the problem I’d guess you might be able to install it declaratively in your config files, but I haven’t tested it.

I suggest you report that problem to the creator of that search tool since every nix-shell invocation they give for nixpkgs older than 19.09 will fail with any Nix > 2.3. I don’t think there exists official Nix documentation with those instructions otherwise we’d need to update it there as well.

1 Like

Thanks for the reply. Appreciated.
Curiously NIx 2.10.2 has just been released, installed it
just after posting this issue and the problem no longer exists.
I now have two versions of vim installed using nix-shell vim 8.0.442
and 8.1.578. Not bad at all for a vanilla Debian stable distro.
Only issue now is how to have each version of vim have it’s own dot
file settings. Probably not possible I suspect.
Thanks again

Hosted by Flying Circus.