I’m trying to override the vscode version in my configuration.nix.
I have the following in my environment.SystemPackages to install vscode 1.60.0 (I’m on the nixos-21.05 channel). When I open vscode it still reports the version as 1.57.1 with no extensions installed.
You need to change the hash to trigger a rebuild. If you don’t know the new hash, you can trigger a rebuild and let nix tell you the correct hash (it will complain about hash mismatch). You can achieve this by changing sha256 to lib.fakeSha256 or changing a single character of the current hash.
Sorry, you are right. It was not about the hash. I just assumed it was that because it is a common mistake. But that wouldn’t explain the missing extensions anyway.
I think the problem was using overrideAttrs^1 instead of override^2. overrideAttrs is modifying the set passed to stdenv.mkDerivation but we need to modify the values before that so that variables in here refer to the values we want, which is possible with override.
I tried building the above derivation; VSCode was showing the correct version and the extensions was also successfully installed.