VSCodium: Difference between revisions
imported>Wackbyte m replace non-functional markdown `` with a proper <code></code> |
imported>SuperSamus Added info |
||
Line 1: | Line 1: | ||
VSCodium is a build of [[ | VSCodium is a build of [[Visual Studio Code]] without the proprietary bits that are included in the official distribution. See https://github.com/VSCodium/vscodium#readme for more background. | ||
== | == Installation == | ||
=== NixOS === | |||
< | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ vscodium ]; | environment.systemPackages = with pkgs; [ vscodium ]; | ||
</ | </syntaxHighlight> | ||
Extensions can be managed using the 'vscode-with-extensions' package: | |||
< | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ | |||
</ | vscode-with-extensions.override { | ||
vscode = vscodium; | |||
vscodeExtensions = with vscode-extensions; [ | |||
bbenoist.nix | |||
ms-python.python | |||
ms-azuretools.vscode-docker | |||
ms-vscode-remote.remote-ssh | |||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [ | |||
{ | |||
name = "remote-ssh-edit"; | |||
publisher = "ms-vscode-remote"; | |||
version = "0.47.2"; | |||
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g"; | |||
} | |||
]; | |||
} | |||
]; | |||
</syntaxHighlight> | |||
== | Some examples here: [https://github.com/search?q=extensionFromVscodeMarketplace&type=code GitHub search for "extensionFromVscodeMarketplace"] | ||
It's also possible to install VSCodium via [[Home Manager]]: | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ pkgs | programs.vscode = { | ||
enable = true; | |||
package = pkgs.vscodium; | |||
extensions = | extensions = with pkgs.vscode-extensions; [ | ||
dracula-theme.theme-dracula | |||
vscodevim.vim | |||
yzhang.markdown-all-in-one | |||
in | |||
]; | ]; | ||
} | }; | ||
</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] | |||
* Search for extensions with configurations: [https://search.nixos.org/packages?type=packages&query=vscode-extensions NixOS Search: vscode-extensions] | |||
Please note that some Visual Studio Code extensions have licenses that restrict their use to the official Visual Studio Code builds and therefore do not work with VSCodium. See [https://github.com/VSCodium/vscodium/blob/master/DOCS.md#proprietary-debugging-tools this note on the VSCodium docs page] for what's been found so far and possible workarounds. | Please note that some Visual Studio Code extensions have licenses that restrict their use to the official Visual Studio Code builds and therefore do not work with VSCodium. See [https://github.com/VSCodium/vscodium/blob/master/DOCS.md#proprietary-debugging-tools this note on the VSCodium docs page] for what's been found so far and possible workarounds. | ||
In particular [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh remote-ssh] does not work yet with vscodium. | In particular, [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh remote-ssh] does not work yet with VSCodium. | ||
=== Non-NixOS === | |||
<syntaxHighlight lang="console"> | |||
$ nix-env -iA nixos.vscodium | |||
</syntaxHighlight> | |||
=== Use VS Code extensions without additional configuration === | |||
With the package vscodium.fhs, the editor launches inside a [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard FHS] compliant chroot environment using buildFHSUserEnv. This reintroduces directories such as /bin, /lib, and /usr, which allows for extensions which ship pre-compiled binaries to work with little to no additional nixification. | |||
{{note|From a philosophical view, use of buildFHSUserEnv allows for ease-of-use at the cost of some impurity and non-reproducibility. If you prioritize purely-declarative configurations, please stay with the above guidance.}} | |||
Example usage: | |||
<syntaxHighlight lang=nix> | |||
environment.systemPackages = with pkgs; [ vscodium.fhs ]; | |||
</syntaxHighlight> | |||
Home-manager: | |||
<syntaxHighlight lang=nix> | |||
programs.vscode = { | |||
enable = true; | |||
package = pkgs.vscodium.fhs; | |||
}; | |||
</syntaxHighlight> | |||
Adding extension-specific dependencies, these will be added to the FHS environment: | |||
<syntaxHighlight lang=nix> | |||
# needed for rust lang server extension | |||
programs.vscode.package = pkgs.vscodium.fhsWithPackages (ps: with ps; [ rustup zlib ]); | |||
</syntaxHighlight> |
Revision as of 13:54, 8 July 2022
VSCodium is a build of Visual Studio Code without the proprietary bits that are included in the official distribution. See https://github.com/VSCodium/vscodium#readme for more background.
Installation
NixOS
environment.systemPackages = with pkgs; [ vscodium ];
Extensions can be managed using the 'vscode-with-extensions' package:
environment.systemPackages = with pkgs; [
vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = with vscode-extensions; [
bbenoist.nix
ms-python.python
ms-azuretools.vscode-docker
ms-vscode-remote.remote-ssh
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "remote-ssh-edit";
publisher = "ms-vscode-remote";
version = "0.47.2";
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
}
];
}
];
Some examples here: GitHub search for "extensionFromVscodeMarketplace"
It's also possible to install VSCodium via Home Manager:
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = with pkgs.vscode-extensions; [
dracula-theme.theme-dracula
vscodevim.vim
yzhang.markdown-all-in-one
];
};
- See for more options: Home Manager Manual: Options - programs.vscode
- Search for extensions with configurations: NixOS Search: vscode-extensions
Please note that some Visual Studio Code extensions have licenses that restrict their use to the official Visual Studio Code builds and therefore do not work with VSCodium. See this note on the VSCodium docs page for what's been found so far and possible workarounds. In particular, remote-ssh does not work yet with VSCodium.
Non-NixOS
$ nix-env -iA nixos.vscodium
Use VS Code extensions without additional configuration
With the package vscodium.fhs, the editor launches inside a FHS compliant chroot environment using buildFHSUserEnv. This reintroduces directories such as /bin, /lib, and /usr, which allows for extensions which ship pre-compiled binaries to work with little to no additional nixification.
Example usage:
environment.systemPackages = with pkgs; [ vscodium.fhs ];
Home-manager:
programs.vscode = {
enable = true;
package = pkgs.vscodium.fhs;
};
Adding extension-specific dependencies, these will be added to the FHS environment:
# needed for rust lang server extension
programs.vscode.package = pkgs.vscodium.fhsWithPackages (ps: with ps; [ rustup zlib ]);