gpt4 book ai didi

nixos - 如何安装 vscode 的扩展?

转载 作者:行者123 更新时间:2023-12-04 12:17:29 26 4
gpt4 key购买 nike

这是一个初学者的问题。所以有一个包vscode-with-extensions .
package说:

A set of vscode extensions to be installed alongside the editor. Here's a an example:


vscode-with-extensions.override {
# When the extension is already available in the default extensions set.
vscodeExtensions = with vscode-extensions; [
bbenoist.Nix
]
# Concise version from the vscode market place when not available in the default set.
++ vscode-utils.extensionsFromVscodeMarketplace [
{
name = "code-runner";
publisher = "formulahendry";
version = "0.6.33";
sha256 = "166ia73vrcl5c9hm4q1a73qdn56m0jc7flfsk5p5q41na9f10lb0";
}
];
}

在哪里 configuration.nix我必须把这个表达吗?我已经有了
  environment.systemPackages = with pkgs; [
wget
vim
vscode-with-extensions
];

其中。

最佳答案

你应该直接在 configuration.nix 中使用它,例如

  environment.systemPackages = with pkgs; [
wget
vim
(vscode-with-extensions.override {
# When the extension is already available in the default extensions set.
vscodeExtensions = with vscode-extensions; [
bbenoist.Nix
]
# Concise version from the vscode market place when not available in the default set.
++ vscode-utils.extensionsFromVscodeMarketplace [
{
name = "code-runner";
publisher = "formulahendry";
version = "0.6.33";
sha256 = "166ia73vrcl5c9hm4q1a73qdn56m0jc7flfsk5p5q41na9f10lb0";
}
];
})
];
或者,在更易读的版本中:
environment.systemPackages = with pkgs;
let
vcsodeWithExtension = vscode-with-extensions.override {
# When the extension is already available in the default extensions set.
vscodeExtensions = with vscode-extensions; [
bbenoist.Nix
]
# Concise version from the vscode market place when not available in the default set.
++ vscode-utils.extensionsFromVscodeMarketplace [
{
name = "code-runner";
publisher = "formulahendry";
version = "0.6.33";
sha256 = "166ia73vrcl5c9hm4q1a73qdn56m0jc7flfsk5p5q41na9f10lb0";
}
];
})
in
[
wget
vim
vcsodeWithExtension
];

关于nixos - 如何安装 vscode 的扩展?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54811067/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com