Visual Studio Code: Difference between revisions

Klinger (talk | contribs)
m Category:Applications
Bittner (talk | contribs)
Option renamed: extensions -> profiles.default.extensions
 
(4 intermediate revisions by 4 users not shown)
Line 37: Line 37:
Some examples here: [https://github.com/search?q=extensionFromVscodeMarketplace&type=code GitHub search for "extensionFromVscodeMarketplace"]
Some examples here: [https://github.com/search?q=extensionFromVscodeMarketplace&type=code GitHub search for "extensionFromVscodeMarketplace"]


Note: For fetching the sh256 string you can use the following command. Make sure to replace the author, the package name and version!<syntaxhighlight lang="bash">
Note: For fetching the sha256 string you can use the following command. Make sure to replace the author, the package name and version!<syntaxhighlight lang="bash">
nix-prefetch-url https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode-remote/vsextensions/remote-ssh-edit/0.47.2/vspackage  
nix-prefetch-url https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode-remote/vsextensions/remote-ssh-edit/0.47.2/vspackage  
</syntaxhighlight>{{ic|extensionsFromVscodeMarketplace}} is a manual way to fetch extensions. However, to keep updated from upstream, [https://github.com/nix-community/nix-vscode-extensions nix-community/nix-vscode-extensions] provides the Nix expressions for the majority of available extensions from Open VSX and VSCode Marketplace. A GitHub Action updates the extensions daily.
</syntaxhighlight>{{ic|extensionsFromVscodeMarketplace}} is a manual way to fetch extensions. However, to keep updated from upstream, [https://github.com/nix-community/nix-vscode-extensions nix-community/nix-vscode-extensions] provides the Nix expressions for the majority of available extensions from Open VSX and VSCode Marketplace. A GitHub Action updates the extensions daily.
Line 46: Line 46:
programs.vscode = {
programs.vscode = {
   enable = true;
   enable = true;
   extensions = with pkgs.vscode-extensions; [
   profiles.default.extensions = with pkgs.vscode-extensions; [
     dracula-theme.theme-dracula
     dracula-theme.theme-dracula
     vscodevim.vim
     vscodevim.vim
Line 54: Line 54:
</syntaxhighlight>
</syntaxhighlight>


* See for more options: [https://nix-community.github.io/home-manager/options.html#opt-programs.vscode.enable Home Manager Manual: Options - programs.vscode]
* See for more options: [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.vscode.enable Home Manager Manual: Options - programs.vscode]
* Search for extensions with configurations: [https://search.nixos.org/packages?type=packages&query=vscode-extensions NixOS Search: vscode-extensions]
* Search for extensions with configurations: [https://search.nixos.org/packages?type=packages&query=vscode-extensions NixOS Search: vscode-extensions]


Line 269: Line 269:
== Troubleshooting ==
== Troubleshooting ==


=== Error after Sign On  ===
=== Writing login information to the keychain failed ===


If you get such an error after sign on in application:
If you get an error similar to the following, enable a [[Secret Service]] provider.


<pre>
<pre>Writing login information to the keychain failed with error 'The name org.freedesktop.secret was not provided by any .service files'.</pre>
Writing login information to the keychain failed with error 'The name org.freedesktop.secret was not provided by any .service files'.
</pre>
 
Try to add the following setting in your system configuration (even if you don't use Gnome as desktop environment):
 
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
# needed for store VS Code auth token
services.gnome.gnome-keyring.enable = true;
</nowiki>}}
 
''Optional'': add <code>gnome.seahorse</code> to <code>environment.systemPackages</code> to install GUI for GNOME Keyring.
 
Don't forget to perform <code>nixos-rebuild switch</code> and reboot the system.


=== Server did not start successfully ===
=== Server did not start successfully ===
Line 332: Line 319:


[[Category:Applications]]
[[Category:Applications]]
[[Category:IDE]]