这是个初学者的问题。所以有一个包vscode-with-extensions。套餐说:
要安装在编辑器旁边的一组vscode扩展。下面是一个例子:
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
];在里面。
发布于 2019-02-21 16:34:17
您应该像直接在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
];发布于 2019-02-21 16:34:05
因此,显然它可以直接进入environment.systemPackages,但需要括号:
environment.systemPackages = with pkgs; [
wget
vim
(vscode-with-extensions.override {
vscodeExtensions = with vscode-extensions; [
bbenoist.Nix
];
})
];https://stackoverflow.com/questions/54811067
复制相似问题