Troubleshooting package update misbehavior

I have been trying to use the cudatoolkit package so I can build a separate repository with help from the nix package management system.

Previously, I had a nix-shell environment that was set up to compile the llama.cpp repository. But after a few days, when I re-activated my nix shell, it is all of the sudden saying it can no longer find a few static cuda libraries. I noticed this happened after activating the shell required downloading new stuff and building again (presumably new cudatoolkit package updates).

I confirmed I still have older versions of this package in my /nix filesystem, because I searched for the missing static libraries and found them. I also know I can use them to build parts of the llama.cpp repository.

So I am stuck trying to figure out how to proceed.

Did you update your channels? Do you fetchurl nixpkgs?

The packages in /nix persist until you nix-collect-garbage, even if they are no longer used, so that does not indicate that your shell is using any specific files in there.