Thanks I’ll try that mkShell/shell.nix thing next. Is there a way to do it with only the nix-shell command? Ah… I assume I’d need to write the mkShell expression in the command?
I’m just trying to figure what’s the simplest way to manage this, so it is as easy as if I were using n 13.6.0 to manage node versions.
I’ve not yet experimented with one-off nix-shells but only declarative ones which have a shell.nix file. Additionally I use direnv to avoid the need of having to remember switching the shells manually
If you’ve already run nix-build, I believe you should also be able to do the following:
$ nix-shell -p ./result
This should put you in a nix-shell with everything in result/ in your PATH. This should “just work”.
Instead of passing the result/ soft-link, I believe you can also pass any /nix/store/ derivation as well.
Although keep in mind that @NobbZ’s suggestion of actually creating a shell.nix file that is reproducible is the easier option if you plan on using this frequently.