xzfc / cached-nix-shell

Instant startup time for nix-shell
https://xzfc.github.io/cached-nix-shell/cached-nix-shell.1
The Unlicense
203 stars 16 forks source link

allow using nixpkgs from flake? #31

Open KiaraGrouwstra opened 11 months ago

KiaraGrouwstra commented 11 months ago

to improve reproducibility i'm now using a nixpkgs pinned thru a flake rather than having a global one. this seems to confuse nix-cached-shell:

cached-nix-shell: updating cache
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels/nixos' does not exist, ignoring
error:
       … <borked>

         at «none»:0: (source not available)

       … while calling the 'import' builtin

         at «string»:1:18:

            1| {...}@args: with import <nixpkgs> args; (pkgs.runCommandCC or pkgs.runCommand) "shell" { buildInputs = [ (ruby) ]; } ""
             |                  ^

       (stack trace truncated; use '--show-trace' to show the full trace)

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

       at «none»:0: (source not available)
cached-nix-shell: nix-shell: exit status: 1

would it there be a way to have it use the flake one (or conversely, mark that as a 'global' channel) somehow?