Visual Studio Code: Difference between revisions

imported>Blackpill0w
m Added an example for getting the SHA256 of an extension
imported>Dezren39
update for latest vscode insider issues
Line 96: Line 96:
   src = (builtins.fetchTarball {
   src = (builtins.fetchTarball {
     url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64";
     url = "https://code.visualstudio.com/sha/download?build=insider&os=linux-x64";
     sha256 = "1dajhfsdr55mfnj12clf5apy1d4swr71d3rfwlq2hvvmpxvxsa59";
     sha256 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
   });
   });
   version = "latest";
   version = "latest";
  buildInputs = oldAttrs.buildInputs ++ [ pkgs.krb5 ];
});
});
</syntaxHighlight>
</syntaxHighlight>


You will need to update the <code>sha256</code> value for each new Insiders build. The new value will appear in a validation error when you try to build.
You will need to update the placeholder <code>sha256</code> value for each new Insiders build.
 
The new value will appear in a validation error when you try to build.


Example:
Example:


Put an arbitrary value in the sha256 field, try to build and you'll get an error message like this:
Put an arbitrary placeholder value in the <code>sha256</code> field, try to build and you'll get an error message regarding the sha256 value.
 
If the error examples begin <code>sha256:</code> follow these instructions:
 
<pre>
<pre>
//-- ...
//-- ...
error: hash mismatch in fixed-output derivation '/nix/store/path':
      error: hash mismatch in file downloaded from 'https://code.visualstudio.com/sha/download?build=insider&os=linux-x64':
        specified: sha256:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
        got:      sha256:16fzxqs6ql4p2apq9aw7l10h4ag1r7jwlfvknk5rd2zmkscwhn6z
//-- ...
</pre>
 
Take that last line and input it where your placeholder was,  'sha256:' in the beginning should be removed.
 
If the error examples begin <code>sha256-</code> follow these instructions:
 
<pre>
//-- ...
        error: hash mismatch in fixed-output derivation '/nix/store/path':
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
         specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
             got:    sha256-aQvTtZdPU2F1UjkFxiLs4A+60A4qc9bXKwKriNsCDPg=
             got:    sha256-aQvTtZdPU2F1UjkFxiLs4A+60A4qc9bXKwKriNsCDPg=
Line 116: Line 135:


Take that last line and run the following python script (you can search for an online python interpreter if it's not installed), the output will give you the correct value:
Take that last line and run the following python script (you can search for an online python interpreter if it's not installed), the output will give you the correct value:
<syntaxHighlight lang=python>
<syntaxHighlight lang=python>
import base64
import base64
Line 122: Line 142:
print(base64.decodebytes(text).hex())
print(base64.decodebytes(text).hex())
</syntaxHighlight>
</syntaxHighlight>
Take the output from this command and input it where your placeholder was.


== Wayland ==
== Wayland ==