Nix search path entry '' cannot be downloaded

I am using Nix on Guix for a project of our company. For that, we have an .envrc file:

export NIX_REMOTE=daemon
use nix -I nixpkgs= -p ...

I only get the following error as a result, however:

warning: Nix search path entry '' cannot be downloaded, ignoring
       … while calling anonymous lambda

         at «string»:1:1:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (jdk21_headless) (clojure) (cljfmt) (postgresql_15_jit) (nodejs_20) (clj-kondo) (babashka) (clojure-lsp) (process-compose) (doctl) (awscli2) (bmake) ]; } ""
             | ^

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

       at «none»:0: (source not available)
direnv: export +NIX_REMOTE

The nix daemon is running. I tried to alternatively run it directly on the command line, using nix-shell -I -p ..., but that gives me the same result.

What is going wrong?

You probably want -I nixpkgs=$val, not -I $val. This works for me on NixOS:

$ NIX_PATH= nix-shell -I nixpkgs= -p re2c
$$ re2c --version
re2c 3.1

Thank you, but this unfortunately gives me the exact same error as well.

Try adding -vvvvv into the command to see what fails:

$ NIX_PATH= nix-shell -vvvvv -I nixpkgs= -p re2c
evaluating file '<nix/derivation-internal.nix>'
using cache entry '{"_what":"tarballCache","url":""}' -> '{"etag":"W/\"4f2c15cc29a0408d3d0bfefd7d0dcdc1d66b8ef8add1f205e42a1652f86aca64\"","lastModified":1714685007,"treeHash":"9c8b26f2fb2229276f3d772331796ff16b9436c9"}'
source path '«unknown»/' is uncacheable
copying '«unknown»/' to the store...
performing daemon worker op: 7

Maybe it will hint you what fails for you.

1 Like

Ah, that helped! Turns out it is a ca-certificate issue on my end.