Starting nix-shell without rebuilding


I have some nix shells for python with tensorflow, openCV, CUDA. It takes ages to build. I like keeping my system up to date so I update channels often, but unlike nix-shell, that doesn’t stop me from using previous versions of software until build is completed (or often deferred to be done over night).

I might have updated the system days before and only next time I want to urgently use my shell I end up waiting for hours to get back my development environment…

Cannot find how to use cached version of the shell anywhere or to stop it from updating in any way.
Could someone advise how I should organise my work to avoid that issue?

where can we see these nix ‘shells’.


Fantastic, didn’t know about this command, thanks!

@rofrol I think this page isn’t explanatory enough for me. It doesn’t explain how nix-instantiate can be used with shell apart form one example command that doesn’t really work for me, $ nix-instantiate shell.nix --indirect --add-root ./.nix-gc-roots/shell.drv ... is looking for a file default.nix which isn’t relevant I believe.
I tried running what I understood should create build outputs in a directory not to be garbage collected:
nix-instantiate tf-shell-new.nix --indirect --add-root ./shellbuilds
However on running nix-shell tf-shell-new.nix it still gets any new packages.

I know that I can pin the shell to specific git revision of nixos, but this is not what I’m looking for.

@nixinator here is my shell: config/tf-shell-new.nix at ae71441c1a80d9e4b4f144a26f2993d9f6300a17 · mixmixmix/config · GitHub

Any further help appreciated.

Maybe this GitHub - nix-community/nix-direnv: A fast, persistent use_nix/use_flake implementation for direnv [maintainer=@Mic92] or Introducing lorri, your project's nix-env

thanks for shell, i’ve been delayed getting back to you, ‘because’.

I presume you have reviewed this issue and tried the solutions out there?

may work, may not, things evolve fast around here.