nix-community / nix-vscode-extensions Goto Github PK
View Code? Open in Web Editor NEWNix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
License: MIT License
Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
License: MIT License
I have the following codes:
extensions = with vscode-marketplace;[
yzhang.markdown-all-in-one
redhat.vscode-xml
enkia.tokyo-night
(forVSCodeVersion "1.79.2").waderyan.gitblame
];
But when I build, it always tell me:
(stack trace truncated; use '--show-trace' to show the full trace)
error: attribute 'waderyan' missing
at /nix/store/c6x6hp4afc244di9pkqxyfmrrl456fbn-source/config/vscode.nix:23:5:
22| enkia.tokyo-night
23| (forVSCodeVersion "1.79.2").waderyan.gitblame
| ^
the codelldb in marketplace is just a downloader, it download the truely plugin from github .
if it's possible replace codelldb with the github ones?
I build codelldb by this codes:
vscode-lldb = pkgs.vscode-utils.buildVscodeExtension {
name = "vadimcn.vscode-lldb";
vscodeExtPublisher = "vadimcn";
vscodeExtName = "codelldb";
src = (pkgs.fetchurl {
url = "https://github.com/vadimcn/codelldb/releases/download/v1.9.2/codelldb-x86_64-linux.vsix";
sha256 = "sha256-iYvSKyUFsSZx/ufS/hq7OE3GDRP1/sK0tlDQ2sP4PXU=";
name = "codelldb.zip";
}).outPath;
vscodeExtUniqueId = "vadimcn.vscode-lldb";
version = "1.9.2";
};
Platform-specific extensions take precedence over universal extensions. In the case of the official Vue extension (Vue.volar), new versions do not provide a platform-specific revision. It means that the last version that has platform-specific revision (1.2.0) overrides the latest version (2.0.8 as of writing). Here is an excerpt of the JSON file:
{"engineVersion":"^1.82.0","lastUpdated":"2024-03-28T22:58:46.19Z","missingTimes":0,"name":"volar","platform":"universal","publisher":"vue","sha256":"sha256-OBHMLSuOs7kuiY0zs6E9ZhGZ3xkuJtMv0jbMRJdT3u4=","version":"2.0.8"}
, {"engineVersion":"^1.67.0","lastUpdated":"2023-02-25T00:09:41.69Z","missingTimes":0,"name":"volar","platform":"linux-x64","publisher":"vue","sha256":"sha256-mNfva56RWBjWKnod4fGZZxKkAzIWWPNtMirNiLMDtVo=","version":"1.2.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2023-02-25T00:09:15.983Z","missingTimes":0,"name":"volar","platform":"linux-arm64","publisher":"vue","sha256":"sha256-I2wD+7vLv8dn+kAN93TkNkMycEnLxjFhZqAXKPWUWP8=","version":"1.2.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2023-02-25T00:10:20.397Z","missingTimes":0,"name":"volar","platform":"darwin-x64","publisher":"vue","sha256":"sha256-FLFSNdDtK6pvC06wU69GFhuEQfIS4n13mFUrB37/Rso=","version":"1.2.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2023-02-25T00:09:46.947Z","missingTimes":0,"name":"volar","platform":"darwin-arm64","publisher":"vue","sha256":"sha256-pO5wfZwkj3fztVpsVRefpbuRDq6BMPUNSB+NhExu4Gg=","version":"1.2.0"}
How can this be solved? I am willing to contribute but I don't know what would behavior would be preferable. Some options:
Output of home-manager switch
:
warning: Git tree '/home/kurisu/NixOS' is dirty
error: builder for '/nix/store/bccw3jk0hkg0g6v3qjg8cx536v9ga09w-vscode-extension-oracle-oracledevtools-21.8.0.drv' failed with exit code 1;
last 3 log lines:
> unpacking sources
> unpacking source archive /nix/store/javnnm6lvbkjpn87ciipdlvr796ci4d7-oracledevtools-21.8.0.zip
> unpacker produced multiple directories
For full logs, run 'nix log /nix/store/bccw3jk0hkg0g6v3qjg8cx536v9ga09w-vscode-extension-oracle-oracledevtools-21.8.0.drv'.
error: 1 dependencies of derivation '/nix/store/9qb7lgra7pirly6mpw6n39dyfy5msqbp-hm_.vscodeextensions.extensionsimmutable.json.drv' failed to build
error: 1 dependencies of derivation '/nix/store/8mq63gvz8n1qi4542bkwqp2qak24q1z7-home-manager-files.drv' failed to build
error: 1 dependencies of derivation '/nix/store/y157df1sfnnn3z8flgiadc1qzi2621dn-home-manager-generation.drv' failed to build
Here my shortened flake.nix
:
inputs.nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
outputs = {...}@inputs {
overlays = [ inputs.nix-vscode-extensions.overlays.default ];
};
pkgs = import nixpkgs {
inherit overlays;
};
And here my shortened home.nix
:
programs.vscode = {
enable = true;
extensions = with pkgs-stable.vscode-marketplace; [
oracle.oracledevtools # <--- This does not work
catppuccin.catppuccin-vsc # <--- This works
];
};
I'm really not sure where to even start looking so if anyone got an idea.. that would be great :)
If you need any additional information just ask me.
#29 mentions home-manager, however only when using flakes. I currently have no interest in using flakes, so I hope it's possible to use it with a traditional config.
Thanks 😄
I removed the overlay to let the flake into nixos-search (see #2 ). Some day, we can restore it.
nix flake check
should workI have issue to install Cucumber Extension in latest VScode version.
There is a fork to fix the issue from other developer and they provide .vsix to solve the extension compatibility.
Here is .vsix that solve the issues: https://github.com/xeger/cucumber-vscode/releases/tag/v1.7.1
How to add it in nix-vscode-extensions so that it can be used in nix VSCode?
I use flake.nix to run the nix
This is an issue to track known/anticipated build problems and solutions
For some reason, github.copilot
doesn't exist in vscode-marketplace, (though for some reason github.copilot-labs does exist). Is there any kind of filter happening in the job that pulls extensions?
Running:
λ nix flake new vscodium-project -t github:nix-community/nix-vscode-extensions
results in the error:
λ nix flake new vscodium-project -t github:nix-community/nix-vscode-extensions
error: flake 'github:nix-community/nix-vscode-extensions' does not provide attribute 'templates.default' or 'defaultTemplate'
This template returns a 404:
https://github.com/nix-community/nix-vscode-extensions/blob/master/templates/flake.nix
Thanks.
Currently, we can't have a Contributors section because this repo is forked. See the docs.
Here's an instruction to unfork a repo.
cc @adisbladis
Is there any way built into the flake to add configuration settings for VSCode? I tried to unsuccessfully find parameters for it.
These are the current config options that I use in my Home Manager VSCode config: https://github.com/heywoodlh/nixos-configs/blob/master/roles/home-manager/desktop.nix#L27-L58
I'd love to be able to use those types of configs with this flake.
I suspect it shouldn't be too difficult to add a config file, but before trying to come up with a solution myself, I thought I would ask, as it seems like something that could be already supported.
(Also, thanks to all involved for such a great flake!)
I updated my flake sources today and got the following error:
error: attribute 'code-spell-checker' missing
at /nix/store/pdwfrbvzvya04vwx1712fdqqpbnqfbdd-source/home-manager/common/vscode/extensions.nix:39:5:
38| shd101wyy.markdown-preview-enhanced
39| streetsidesoftware.code-spell-checker
| ^
40| tamasfe.even-better-toml
I looked through the commit history and noticed that the extension has been removed in the update 12 hours ago (fd8cee8#diff-db06c147305f13309bc4ca7b66da962d0b9e166ae2ed780c000531d2d78841ebL1974)
I considered that it might have been removed from VSX, but looking at the site, it seems to still be available https://open-vsx.org/extension/streetsidesoftware/code-spell-checker (though the site version is 2.17.1, while the one in the repo was 2.16.0)
Is there a reason for the extension disappearing or could this be caused by a bug in the automatic generation of the extension itself?
I detected this issue because for some extensions, I'm using the derivation from upstream nixpkgs but the extension versions from nix-vscode-extensions. I'm running NixOS so I need the patches from nixpkgs for these extensions to work, but nixpkgs is slow to update VSCode extensions, so I use nix-vscode-extensions to get updates more frequently. (Yes, this setup tends to break often.)
Since commit 9a610ee, the flake exposes version 1.7.1 of ms-vscode.cpptools instead of 1.20.0 on x86_64-linux:
$ nix eval github:nix-community/nix-vscode-extensions/57e9fd03e06ce8f86fb31523f72d11e3026ff8a5#extensions.x86_64-linux.vscode-marketplace.ms-vscode.cpptools.version
"1.20.0"
$ nix eval github:nix-community/nix-vscode-extensions/9a610eef24e656d771df4097da761d458dd7fc97#extensions.x86_64-linux.vscode-marketplace.ms-vscode.cpptools.version
"1.7.1"
I noticed that in data/cache/vscode-marketplace-latest.json
, there's a line for 1.7.1 of ms-vscode.cpptools for the "universal" platform, and in commit 9a610ee, it moved from before the more recent platform-specific lines to after them.
@@ -35369,34 +35621,38 @@
, {"engineVersion":"^1.75.0","lastUpdated":"2024-01-19T23:50:59.02Z","missingTimes":0,"name":"azurecli","platform":"universal","publisher":"ms-vscode","sha256":"sha256-G+dDdAc4xeHYQRSx2e4KcwZnSyDOR5Y04NMGgJ1ztNM=","version":"0.6.0"}
, {"engineVersion":"^1.6.0","lastUpdated":"2021-02-26T01:01:38.197Z","missingTimes":0,"name":"brackets-keybindings","platform":"universal","publisher":"ms-vscode","sha256":"sha256-FKn79LIxfuRcMZErlyEZOYoRU4jRYaKmldoeRPZLWA4=","version":"0.1.1"}
, {"engineVersion":"^1.51.0","lastUpdated":"2021-02-26T01:00:52.19Z","missingTimes":0,"name":"brackets-pack","platform":"universal","publisher":"ms-vscode","sha256":"sha256-/5+cXP7LjNAru7QSZM4IXFcSEYRe84AsKQW9cefWlY8=","version":"0.1.1"}
-, {"engineVersion":"^1.63.0","lastUpdated":"2024-03-29T04:20:09.953Z","missingTimes":2,"name":"cmake-tools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-/Bb1cKOxoXzNEdVfh4kWadFz1mpaqv57K+BbBBVzK2Y=","version":"1.18.16"}
-, {"engineVersion":"^1.63.0","lastUpdated":"2024-04-03T04:18:41.343Z","missingTimes":0,"name":"cmake-tools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-SIIMglXX+OJVYUDcMgR7BPnJlXR1iX7ql1h2hCQQmN8=","version":"1.18.17"}
-, {"engineVersion":"^1.60.0","lastUpdated":"2021-10-20T02:54:55.43Z","missingTimes":0,"name":"cpptools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-2vgkfpoQCA+1B4r3h2YjBhnxYf2inCojNDFXALh9hkE=","version":"1.7.1"}
+, {"engineVersion":"^1.63.0","lastUpdated":"2024-03-29T04:20:09.953Z","missingTimes":3,"name":"cmake-tools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-/Bb1cKOxoXzNEdVfh4kWadFz1mpaqv57K+BbBBVzK2Y=","version":"1.18.16"}
+, {"engineVersion":"^1.63.0","lastUpdated":"2024-04-03T04:18:41.343Z","missingTimes":1,"name":"cmake-tools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-SIIMglXX+OJVYUDcMgR7BPnJlXR1iX7ql1h2hCQQmN8=","version":"1.18.17"}
+, {"engineVersion":"^1.63.0","lastUpdated":"2024-04-05T04:17:37.663Z","missingTimes":0,"name":"cmake-tools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-lxZFVW3P/tFF37/G0jSzO52xyB35rpB7TdYn4xBtXyA=","version":"1.18.19"}
, {"engineVersion":"^1.67.0","lastUpdated":"2024-03-26T22:36:56.033Z","missingTimes":0,"name":"cpptools","platform":"linux-x64","publisher":"ms-vscode","sha256":"sha256-hnLIvqKXCwrVCPCX5zriZWf5om0m073qK19gubvgaq8=","version":"1.20.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2024-03-26T22:35:36.363Z","missingTimes":0,"name":"cpptools","platform":"linux-arm64","publisher":"ms-vscode","sha256":"sha256-WMZxpaGWswH6cvd4DpdnkuV9Oabe4CFTPT5871/thAQ=","version":"1.20.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2024-03-26T22:36:31.703Z","missingTimes":0,"name":"cpptools","platform":"darwin-x64","publisher":"ms-vscode","sha256":"sha256-5Xz7nzqSG7rhLLtogZqUy0vSgO4umlkMUzba3uL6tjk=","version":"1.20.0"}
, {"engineVersion":"^1.67.0","lastUpdated":"2024-03-26T22:34:37.72Z","missingTimes":0,"name":"cpptools","platform":"darwin-arm64","publisher":"ms-vscode","sha256":"sha256-y7DhVcz3diTgTNHjIboyhoQ7R7AkB/UXJ5c5u8hav+8=","version":"1.20.0"}
+, {"engineVersion":"^1.60.0","lastUpdated":"2021-10-20T02:54:55.43Z","missingTimes":0,"name":"cpptools","platform":"universal","publisher":"ms-vscode","sha256":"sha256-2vgkfpoQCA+1B4r3h2YjBhnxYf2inCojNDFXALh9hkE=","version":"1.7.1"}
, {"engineVersion":"^1.48.0","lastUpdated":"2022-09-01T21:59:39.913Z","missingTimes":0,"name":"cpptools-extension-pack","platform":"universal","publisher":"ms-vscode","sha256":"sha256-rHST7CYCVins3fqXC+FYiS5Xgcjmi7QW7M4yFrUR04U=","version":"1.3.0"}
, {"engineVersion":"^1.30.0","lastUpdated":"2022-10-24T21:51:14.927Z","missingTimes":0,"name":"cpptools-themes","platform":"universal","publisher":"ms-vscode","sha256":"sha256-YWA5UsA+cgvI66uB9d9smwghmsqf3vZPFNpSCK+DJxc=","version":"2.0.0"}
, {"engineVersion":"^1.65.0","lastUpdated":"2023-02-17T10:49:33.337Z","missingTimes":4,"name":"extension-activator","platform":"universal","publisher":"ms-vscode","sha256":"sha256-97mSebLFpaAROSIvp6U+GuB+Dsz8ndThEGaYBkFB6c0=","version":"0.0.2"}
Looking at earlier commits, it appears the change is intentional:
However, it doesn't appear to be working as expected. Perhaps a version sort is not implemented correctly somewhere and it thinks 1.7.1 is more recent than 1.20.0? (A naïve textual sort would indeed claim so.)
cc @yacinehmito, @deemp
Got it. The discussion was in NixOS/nixpkgs#208456.
Please, don't abuse this flake to scrape the Marketplace. Just load the necessary extensions.
Tracked in this PR: NixOS/nixos-search#601
When merged, nix-vscode-extensions will be available in https://search.nixos.org/flakes?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=vscode
In further changes, make sure nix flake check
works
sourceRoot = "extension"
when NixOS/nixpkgs#289721 is merged.nixpkgs
overrides.nix
to a separate branch without all cache files so that other solutions like nix4vscode can make use of overrides.When trying to build any extension from open-vsx:
error: undefined variable 'license'
at /nix/store/9r1xp2rj6zazr07z8i304fsjbvwcd1k9-source/flake.nix:41:42:
40| inherit changelog downloadPage homepage;
41| license = licenses.${license};
| ^
42| };
I'm far from a nix pro, but I wanted to add this to my (flaked) homemanager config so I can get all the nice benefits.
Unfortunately, I can't figure out how to do this.
My flake:
{
description = "Home Manager configuration of Spott";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager/";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
/*
flake-utils = {
url = "github:numtide/flake-utils";
};
*/
};
outputs = {
nixpkgs,
home-manager,
nix-vscode-extensions,
...
}:
let
extensions = sys:
nix-vscode-extensions.extensions.${sys}; # I can't figure out how to put this somewhere I can pass to the modules below
overlays = sys: [
(self: super: {
python = super.python310;
})
# is there some way I can pass this here, so I can use it with something like pkgs.nix-vscode-extensions?
];
pkgs = sys:
import nixpkgs {
system = sys;
config = {allowUnfree = true;};
overlays = overlays sys;
};
in {
packages = {
aarch64-darwin.homeConfigurations = {
"[email protected]" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs "aarch64-darwin";
modules = [
./normandy.nix
./common.nix # I want common.nix to have access to the extensions object, but I'm not sure how to do that.
./darwin-common.nix
./zsh/zsh.nix
];
};
"[email protected]" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs "aarch64-darwin";
modules = [
./endeavor.nix
./common.nix
./darwin-common.nix
./zsh/zsh.nix
];
};
};
x86_64-linux.homeConfigurations = {
"spott@devbox" = home-manager.lib.homeManagerConfiguration {
pkgs = pkgs "x86_64-linux";
modules = [
./devbox.nix
./common.nix
./zsh/zsh.nix
];
};
};
};
};
}
I'd appreciate any help, not sure if this is the right place to post this, if not, point me in the right direction.
Biggest pain for us right now is the gitlens extension, which we have to update every other day because nix-vscode-extensions
points to a pre-release version and new pre-release versions require updating the extension otherwise the extension gets deactivated.
I wonder if the API that is crawled has more information about stable vs. pre-release versions.
This issue is a result of the discussion of #41.
Provides the latest versions of almost all extensions and release versions of chosen extensions from VS Code Marketplace and Open VSX.
nix4vscode provides the latest versions compatible with a given VS Code version (see #41) for chosen extensions.
nixpkgs
(link)extensionFromVscodeMarketplace
doesn't use platform
)nix
Despite some disadvantages, the approach of nix4vscode
seems to be more promising than that of nix-vscode-extensions
. In my opinion, most of nix4vscode
disadvantages can be overcome. Then, it will be a truly personalized tool for getting VS Code extensions.
nix-vscode-extensions
and at what stage of readiness of nix4vscode
nix-vscode-extensions
about deprecation and link this issuenix4vscode
reponix4vscode
instead of nix-vscode-extensions
nix4vscode
to nix-community
to get more contributors
nix4vscode
as it's written in Rustnix4vscode
repolet
pkgs = import <nixpkgs> {};
inherit (pkgs) lib writeTextFile;
inherit (lib) catAttrs pipe importJSON;
inherit (lib.lists) unique naturalSort last;
file = ./vscode-marketplace-latest.json;
text = pipe file [
importJSON
(catAttrs "engineVersion")
unique
(map (lib.strings.removePrefix "^"))
unique
naturalSort
last
];
output = writeTextFile { name = "engineVersion.txt"; text = text; };
in
output
gets the highest engineVersion
@deemp, do we still need poetry.lock
and pyproject.toml
that you deleted the scripts
directory?
The README talks about 40000 extensions.
I can only find 7:
nix-repl> :lf github:nix-community/nix-vscode-extensions/27ce569
nix-repl> extensions.x86_64-linux.vscode-marketplace-release.<TAB>
extensions.x86_64-linux.vscode-marketplace-release.eamodio
extensions.x86_64-linux.vscode-marketplace-release.github
extensions.x86_64-linux.vscode-marketplace-release.ms-dotnettools
extensions.x86_64-linux.vscode-marketplace-release.ms-vscode-remote
extensions.x86_64-linux.vscode-marketplace-release.rust-lang
extensions.x86_64-linux.vscode-marketplace-release.stkb
extensions.x86_64-linux.vscode-marketplace-release.vadimcn
Where are the other 39.993? 🤔
Noticed this at the console:
Error while activating TypeScript/JavaScript: {"errno":-2,"code":"ENOENT","syscall":"stat","path":"/nix/store/lc0l4y05jrfpqr5j5h70pjchpx801h6y-vscode-extension-visualstudioexptteam-vscodeintellicode-1.2.30/share/vscode/extensions/visualstudioexptteam.vscodeintellicode/cache"}.
I suppose this extension in particular isn't following the best practices and stuff, but I wonder what would be a fix that doesn't depend on upstream.
I use nix to install vscode. Since flake.lock cannot be updated in such a timely manner, and the vscode version of nix is not always the latest. Expansion incompatibilities often arise. Is it possible to automatically fetch the last extension compatible with a specified vscode version?
UPD: nix4vscode solves this problem.
I believe the recent commit - 88eb88c added a dependency on patchelf which is now missing.
Should it have been pkgs.patchelf?
last 11 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/gy7q5dwagzqjvxgkv1pg7d8s7j9jyvxv-vscode-lldb-v1.10.0.zip
> source root is extension
> setting SOURCE_DATE_EPOCH to timestamp 1694803328 of file extension/README.md
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> Running phase: buildPhase
> Running phase: installPhase
> /nix/store/9kswmdwjwz05aawgcbxg9krsxq00rgih-stdenv-darwin/setup: line 124: patchelf: command not found
> /nix/store/9kswmdwjwz05aawgcbxg9krsxq00rgih-stdenv-darwin/setup: line 140: pop_var_context: head of shell_variables not a function context
For full logs, run 'nix log /nix/store/5yag9pikhrlzx0kh2c8lvwg043kzi02y-vscode-extension-vadimcn-vscode-lldb-v1.10.0.drv'.
I propose that we track problematic extensions (looking at rust-analyzer
) and only push these specific extensions to the stable branch when they have been checked after an automatic update.
specified: sha256-ttLGbPikx3khbjRiubNjlkEF5uX/T3NkpdpSCbELEKw=
got: sha256-VHBxuVz7Dul/yIRnlhep3sKx9qCOOexVjLciBB1c23Y=
It seems that extension packs doesn't work. For example: https://marketplace.visualstudio.com/items?itemName=vshaxe.haxe-extension-pack
It only installs the pack but nothing else.
When trying to add extensions using this flake I'm seeing the error attribute 'vscodeExtPublisher' missing
. I ran nix flake update
last Friday, where I could build my configuration successfully. I tried using the example with the nix repl found here and the error is present there as seen below:
$ nix repl
Welcome to Nix 2.11.1. Type :? for help.
nix-repl> :lf .
Added 18 variables.
nix-repl> inputs.nix-vscode-extensions.extensions.x86_64-linux.vscode-marketplace.golang.go
error: attribute 'vscodeExtPublisher' missing
at /nix/store/z8z0bjp8y8ah0qy1kwhgzhiklp0cqibq-source/flake.nix:42:52:
41| }))
42| (builtins.groupBy ({ value, ... }: value.vscodeExtPublisher))
| ^
43| (builtins.mapAttrs (_: lib.listToAttrs))
nix-repl> inputs.nix-vscode-extensions.extensions.x86_64-linux.open-vsx.golang.go
error: attribute 'vscodeExtPublisher' missing
at /nix/store/z8z0bjp8y8ah0qy1kwhgzhiklp0cqibq-source/flake.nix:42:52:
41| }))
42| (builtins.groupBy ({ value, ... }: value.vscodeExtPublisher))
| ^
43| (builtins.mapAttrs (_: lib.listToAttrs))
nix-repl>
Looking through the commit history, it seems to be caused by the changes in 46be1e7, since the line that is referenced in the error message was added in this commit.
I've unfortunately not had time to look into what could resolve this issue.
Please let me know if you need any additional information or I can help out in any other way. This flake is great and it's made it much easier for me to maintain my configuration, so I'll be happy to help out if I can.
Currently on b2ca271 and found that open-vsx.wakatime.vscode-wakatime
errors out:
trying https://open-vsx.org/api/wakatime/vscode-wakatime/24.2.0/file/wakatime.vscode-wakatime-24.2.0.vsix
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
^M 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
error: cannot download vscode-wakatime-24.2.0.zip from any mirror
When compared with the correct link:
https://open-vsx.org/api/WakaTime/vscode-wakatime/24.2.0/file/WakaTime.vscode-wakatime-24.2.0.vsix
The difference is that the namespace WakaTime
is not lowercased but retains its capitalization. Probably the same is also true for the extension ID, but in this case it's all lowercase.
As a quick workaround, vscode-marketplace.wakatime.vscode-wakatime
works fine.
The Netbeans extension (asf.apache-netbeans-java
), possibly others, have multiple directories in the zipfile, and this causes the build to fail:
error: builder for '/nix/store/spmw2bry62skgchvpb6qkk8rf926r745-vscode-extension-asf-apache-netbeans-java-18.0.0.drv' failed with exit code 1;
last 3 log lines:
> unpacking sources
> unpacking source archive /nix/store/rqpc0q8117cy5jcn8hhd84vk92006icd-apache-netbeans-java-18.0.0.zip
> unpacker produced multiple directories
The problem happens on a non-NixOS linux machine with a rather old distro.
I am able to run the extension by applying patchelf to the extension binaries as:
pathToZlib = pkgs.lib.makeLibraryPath [ pkgs.zlib ];
my-vscode-lldb = vscode-market.vadimcn.vscode-lldb.overrideAttrs (oldAttrs: {
postInstall = ''
cd "$out/$installPrefix"
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./adapter/codelldb
patchelf --add-rpath "${pathToZlib}" ./lldb/lib/liblldb.so
'';
});
If I do "nix develop --show-trace", attempting to use ziglang results in an error:
I checked using the method documented and it appears to exist:
nix-repl> t.open-vsx.zig<tab>
t.open-vsx.ziglang t.open-vsx.zignd
However, it fails with :
error:
… while calling the 'derivationStrict' builtin
at //builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'nix-shell'
whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7
… while evaluating attribute 'buildInputs' of derivation 'nix-shell'
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:350:7:
349| depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0;
350| buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1;
| ^
351| depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0;
… while evaluating derivation 'vscodium-with-extensions-1.78.2.23132'
whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7
… while evaluating attribute 'buildCommand' of derivation 'vscodium-with-extensions-1.78.2.23132'
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:87:14:
86| enableParallelBuilding = true;
87| inherit buildCommand name;
| ^
88| passAsFile = [ "buildCommand" ]
… while evaluating derivation 'vscode-extensions'
whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7
… while evaluating attribute 'passAsFile' of derivation 'vscode-extensions'
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:88:7:
87| inherit buildCommand name;
88| passAsFile = [ "buildCommand" ]
| ^
89| ++ (derivationArgs.passAsFile or []);
… while evaluating derivation 'vscode-extensions-json'
whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7
… while evaluating attribute 'text' of derivation 'vscode-extensions-json'
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:139:16:
138| runCommand name
139| { inherit text executable checkPhase meta allowSubstitutes preferLocalBuild;
| ^
140| passAsFile = [ "text" ];
… from call site
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/with-extensions.nix:52:12:
51| destination = "/share/vscode/extensions/extensions.json";
52| text = vscode-utils.toExtensionJson vscodeExtensions;
| ^
53| };
… while calling 'toExtensionJson'
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/extensions/vscode-utils.nix:132:21:
131|
132| toExtensionJson = extensions: builtins.toJSON (map toExtensionJsonEntry extensions);
| ^
133| in
error: attribute 'vscodeExtUniqueId' missing
at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/extensions/vscode-utils.nix:106:12:
105| identifier = {
106| id = ext.vscodeExtUniqueId;
| ^
107| uuid = "";
My flake.nix is basically a copy of the template as follows:
> cat flake.nix
{
inputs = {
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
flake-utils.follows = "nix-vscode-extensions/flake-utils";
nixpkgs.follows = "nix-vscode-extensions/nixpkgs";
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
extensions = inputs.nix-vscode-extensions.extensions.${system};
inherit (pkgs) vscode-with-extensions vscodium;
packages.default =
vscode-with-extensions.override {
vscode = vscodium;
vscodeExtensions = [
extensions.vscode-marketplace.golang.go
extensions.open-vsx.ziglang # <-- This line causes a failure
extensions.open-vsx-release.rust-lang.rust-analyzer
];
};
devShells.default = pkgs.mkShell {
buildInputs = [ packages.default ];
shellHook = ''
printf "VSCodium with extensions:\n"
codium --list-extensions
'';
};
in
{
inherit packages devShells;
});
}
Thanks.
We discard the extensions based on a single request. It may be better to discard them when they're unavailable multiple times.
What we do now:
How we can improve discarding:
unavailable_count
to an extension info. It will record how many times the extension was unavailable.The top-level flake.nix
uses a lot of dunder methods like __filter
which look like the library functions, but aren't. I also don't find any definition for them in the file so I wonder how the whole flake even works. Can someone explain this shortly?
I have tried a few ways to use nix-vscode-extensions with vscode module in home-manager. I have not had luck yet.
My current attempt looks something like this:
Flake.nix
inputs = {
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
};
outputs = inputs@{. . ., nix-vscode-extensions,...}:
let
open-vsx = nix-vscode-extensions.extensions.${system}.open-vsx;
in
{
. . .
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.stephen = import ./${hostname}/home.nix;
home-manager.extraSpecialArgs = {nix-vscode-extensions = open-vsx;}; # have tried a few different things here, this is just current attempt
# also tried inherit inputs above
}
. . .
Home.nix
{ config, pkgs, lib, open-vsx, ... }: <=== I have tried passing "inputs" here, and referencing it differently below.
{
programs.vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
# settings.json
userSettings = {
};
extensions = with open-vsx; [ <===== TRYING TO USE INPUT HERE
...
arrterian.nix-env-selector
...
];
};
I am new to nix, and it would be helpful if I could get some direction or guidance please.
Thanks :)
I'm on revision fd916a94f287d9e1762f02df4f5984867c770b9f
and I'm getting this error (cleaned up):
error: builder for '/nix/store/gxid8alyj5bkjdg3aniv0b44m9c2kq3x-shellcheck-0.32.5.zip.drv' failed with exit code 1;
> trying https://open-vsx.org/api/timonwong/shellcheck/0.32.5/file/[email protected]
> curl: (22) The requested URL returned error: 404
> error: cannot download shellcheck-0.32.5.zip from any mirror
I've checked in devtools on open-vsx, and the url used there seems to be only slightly different (and works):
https://open-vsx.org/api/timonwong/shellcheck/linux-x64/0.32.5/file/[email protected]
The only difference is the linux-x64/
before the version in the path.
back to the revision I was on before:
{
inputs.nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions/fd916a94f287d9e1762f02df4f5984867c770b9f";
}
{extensions = with inputs.nix-vscode-extensions.extensions.${pkgs.system}; (
with open-vsx; [
timonwong.shellcheck
]
);}
Currently only a hand-craft set of extensions are fetched using their release versions, while everything else defaults to (almost always) preview releases. While this wouldn't be a proper fix for #41 it would improve the likelihood of finding a commit of this repo containing stable compatible extensions.
I was initially using in home.nix:
vscode = {
enable = true;
extensions = with pkgs.vscode-extensions; [
jdinhlife.gruvbox
bbenoist.nix
Running sudo nixos-rebuild switch --flake nix-fwk-system/#fwk-nixos
runs without error. Sometimes rarely an extension installs.
If I uninstall the vscode to test reproducibility, rerun the sudo nixos rebuild switch flake...
the extension(s) are not reinstalled.
rm ~/.vscode/extensions/extensions.json
before rerunning the rebuild switch flake makes no difference.
I raised an issue on home-manager github here
I also seeked help from a dedicated NixOS discord. Link to my initial message
The response was to switch to nix-vscode-extensions.
flake.nix
{
description = "nixos flake config";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:pjones/plasma-manager";
inputs = {
home-manager.follows = "home-manager";
nixpkgs.follows = "nixpkgs";
};
};
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
};
outputs = {
self,
nixpkgs,
nixos-hardware,
plasma-manager,
nix-vscode-extensions,
...
}@inputs:
let
system = "x86-64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
extensions = inputs.nix-vscode-extensions.extensions.${system};
in
{
nixosConfigurations = {
fwk-nixos = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs system; };
modules = [
./nixos/configuration.nix
nixos-hardware.nixosModules.framework-16-7040-amd
inputs.home-manager.nixosModules.default
{
home-manager.extraSpecialArgs = { inherit nix-vscode-extensions; };
}
];
};
};
};
}
home.nix
{ config, pkgs, plasma-manager, nix-vscode-extensions, ... }:
{
imports = [
plasma-manager.homeManagerModules.plasma-manager
];
home = {
username = "jat";
homeDirectory = "/home/jat";
stateVersion = "23.11";
packages = with pkgs; [
starship
git
warp-terminal
jq
xclip
flameshot
neofetch
vscode
google-chrome
firefox
discord
spotify
signal-desktop
libsForQt5.polonium
];
file = {
".config/warp-terminal/user_preferences.json".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-fwk-system//configs/warp-terminal.json"; # warp terminal
".config/Code/User/settings.json".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-fwk-system/configs/vscode-settings.json"; # vscode settings.json
};
sessionVariables = {
EDITOR = "code";
};
};
nixpkgs.config.allowUnfree = true;
programs = {
home-manager.enable = true;
plasma = {
enable = true;
workspace = {
lookAndFeel = "org.kde.breezedark.desktop";
};
};
bash.enable = true;
git = {
enable = true;
userName = "Jatinder Randhawa";
userEmail = "[email protected]";
};
starship = {
enable = true;
enableBashIntegration = true;
};
vscode = {
enable = true;
extensions = with nix-vscode-extensions.extensions.${pkgs.system}.vscode-marketplace; [
bbenoist.nix
jdinhlife.gruvbox
bbenoist.nix
github.vscode-pull-request-github
];
};
};
}
Regarding this new config. I struggled with its config and the discord get it working for me. On the first error free run of sudo nixos rebuild flake...
, it installed bbenoist.nix
extension.
Once again to test reproducibility. I uninstalled the extension within vscode then reran sudo nixos rebuild flake...
the same issue persists.
I now suspect that I have a fundamental misunderstanding here or there is an issue with my general config. Suggestions?
I'm trying to figure out how I would go about integrating this into my home-manager configuration and the documentation/examples given in the readme doesn't seem to explain it.
Ideally I'd like to be able to use this with programs.vscode.extensions
in home-manager, (I do have programs.vscode.package
set to pkgs.vscodium
).
As mentioned in #5, the API is non-deterministic without setting the target platform in a query parameter.
@twz123 proposed a way to collect a version - target platform mapping in #5 (comment).
We can add this information to our cache.
For each extension (name
, publisher
), for each platform, we need an object containing the fields lastUpdated
, sha
, version
. We don't need a url
because we can construct it on the fly in Nix.
Our .json
s will be 2+
times larger. I guess, we can for now provide extensions just for Nix-supported platforms.
What should be the mapping from Nix-supported platforms to Marketplace target platforms?
Nix supports:
VSCode Marketplace supports (excluding win
):
Open VSX supports
Not sure why, but rust-lang.rust-analyzer
fails with a bad hash.
error: hash mismatch in fixed-output derivation '/nix/store/1magwzvshwqzxv4npv0m185jfxczmxqn-rust-analyzer-0.4.1381.zip.drv':
specified: sha256-4+fS2fKhkYuPWfp1nrHwkNK7XU9kvs0iB/RtAzBH0sY=
got: sha256-z9pcu0rVMuwYJpJrI1l5YaT+TxlQo762j8RP+MGW2kQ=
error: 1 dependencies of derivation '/nix/store/klyv1hqbx1d4ym4qxidsl8j9352kv2fv-vscode-extension-rust-lang-rust-analyzer-0.4.1381.drv' failed to build
I would like to know why the hash is wrong in this repository, I don't know how the automation/crawler works, but is it even possible for the hash to change on the VSCode Marketplace?
Start of the discussion: https://github.com/orgs/nix-community/teams/nix-vscode-extensions
nvfetcher
may produce incorrect .nix
files because it uses simple string manipulation
description
attribute
description
attributenvfetcher
doesn't extract metadata from the Microsoft marketplace extensions.
package.json
inside the .vsix
file.I'm attempting to get the nx console to work. The console opens, but then throws up error about its client not working. The console is inoperable after that.
Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-x64-glibc. Please ensure it is installed (don't use --no-optional when installing with npm). Otherwise it is possible we don't support your platform yet. If this is the case, please report an issue to https://github.com/parcel-bundler/watcher.
at Object.<anonymous> (/nix/store/hpxn0nksskra5x476x1dab5abpi5l706-vscode-extension-nrwl-angular-console-18.6.0/share/vscode/extensions/nrwl.angular-console/node_modules/@parcel/watcher/index.js:25:13)
at Module._compile (node:internal/modules/cjs/loader:1188:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1243:10)
at Module.load (node:internal/modules/cjs/loader:1058:32)
at Module._load (node:internal/modules/cjs/loader:893:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1082:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/nix/store/hpxn0nksskra5x476x1dab5abpi5l706-vscode-extension-nrwl-angular-console-18.6.0/share/vscode/extensions/nrwl.angular-console/nxls/main.js:776:22675)
at Module._compile (node:internal/modules/cjs/loader:1188:14)
[Error - 11:25:43 AM] The Nx Console Client server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 11:25:43 AM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 11:25:43 AM] Nx Console Client client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 11:25:43 AM] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
Installing a local or global copy of @parcel/watcher doesn't help. See also nrwl/nx-console#1808
Reproduction (but not minimal):
nix develop github:anilanar/shells.nix/why-not-work
cc @nix-community/infra @deemp @AmeerTaweel
I've disabled github actions on this repo, just now it was using all of the organisations quota. (20 parallel jobs that had already been running for 3 hours)
For now, we have two parts of the fetcher (high-level description):
TypeScript
scripts ask sites about extensions' info like name, publisher and latest upload timestamp. Then, the scripts generate a tmp.yaml
with all this info.Haskell
script
tmp.yaml
and checks against another yaml - let it be cache.yaml
- that contains additional info about extensions like calculated SHA
. The script selects the info about extensions that are both in cache.yaml
and tmp.yaml
. These extensions are ready to be included into the updated version of cache.yaml
. The extensions that are in tmp.yaml
, but not in cache.yaml
are fetched, and their SHA
is calculated. Those extensions that were fetched successfully are combined with the ready extensions, they're all sorted and written into cache.yaml
. As the vscode-marketplace
usually returns very similar sets of extensions, it's cheap to update cache.yaml
. The extensions that aren't in tmp.yaml
but are in cache.yaml
are not included into the updated cache.yaml
. This is how we drop the old versions of extensions. The only interesting detail about the Haskell script is that this script spawns a limited number of threads that work on tmp.yaml
and nix store prefetch-file
s so that we don't hit the request rate.cache.yaml
, the script generates nix expressions from that file. Perhaps we should move this generation to Nix (TODO).At a lower level, we work with files that are stored in data/
. data/old/vscode-marketplace.yaml
is like cache.yaml
mentioned above.
As @spikespaz suggested (#9 (comment)), we can choose a language and write all our scripts in that language to improve maintainability.
deno
site which may become inaccessible. @AmeerTaweel , would it be hard to rewrite the Haskell part in TypeScript
without using the deno site? Would you like to do it?A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.