sudo nixos-rebuild switch --upgrade
...
error: getting attributes of path '/nix/store/2xwxj5qrrc71asdk1wyq19nz9k845pzs-patchelf-0.9': No such file or directory
or
nix-shell -p emacs
...
error: getting attributes of path '/nix/store/1mwl1ycqdxqs9g1g916q3pp65vp01kdl-texinfo-6.5': No such file or directory