Visual Studio Code: Difference between revisions
imported>SuperSamus Reorder and cleanup |
imported>SuperSamus No edit summary |
||
Line 61: | Line 61: | ||
=== Use VS Code extensions without additional configuration === | === Use VS Code extensions without additional configuration === | ||
With the package vscode | With the package vscode.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.}} | {{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.}} | ||
Line 67: | Line 67: | ||
Example usage: | Example usage: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
environment.systemPackages = with pkgs; [ vscode | environment.systemPackages = with pkgs; [ vscode.fhs ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
Line 74: | Line 74: | ||
programs.vscode = { | programs.vscode = { | ||
enable = true; | enable = true; | ||
package = pkgs.vscode | package = pkgs.vscode.fhs; | ||
}; | }; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
Line 81: | Line 81: | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
# needed for rust lang server extension | # needed for rust lang server extension | ||
programs.vscode.package = pkgs.vscode | programs.vscode.package = pkgs.vscode.fhsWithPackages (ps: with ps; [ rustup zlib ]); | ||
</syntaxHighlight> | </syntaxHighlight> | ||