Nix VSCode Extensions
At the time of writing this, searching nixpkgs
yields around 200 VS Code
extensions. However, the VS Code Marketplace
contains more than 40,000 extensions!
This flake provides the Nix expressions for the majority of available extensions from Open VSX and VSCode Marketplace. A GitHub Action
updates the extensions daily.
That said, you can now use a different set of extensions for VS Code
(or VSCodium
) in each of your projects. Moreover, you can share your flakes and cache them so that other people don't need to install these extensions manually!
Note
- Extension names and publishers are lowercased.
- If an extension's publisher or name aren't valid Nix identifiers, you may access them by quoting the attribute names like
vscode-marketplace."4"."2"
. - You may search the repo to find out at what commit a given extension was available.
- We have a permission from MS to use a crawler on their API in this case (see the discussion). Please, don't abuse this flake!
Template
A template shows how you can get a VSCodium with a couple of extensions. Try it:
nix flake new vscodium-project -t github:nix-community/nix-vscode-extensions
cd vscodium-project
git init && git add .
nix develop
This will print the extensions available in VSCodium
.
Run codium .
or nix run .#codium .
to start VSCodium
in the current directory.
In case of problems see Troubleshooting.
Example
There's a sample package vscodium-with-extensions
with a couple of extensions that you can try.
nix run github:nix-community/nix-vscode-extensions#vscodium-with-extensions -- --list-extensions
Usage
With flakes
Add the following to your flake.nix
(see Flakes).
inputs = {
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
};
Now, you can explore the extensions in nix repl
:
$ nix repl
nix-repl> :lf .
Added 10 variables.
nix-repl> inputs.nix-vscode-extensions.extensions.x86_64-linux.vscode-marketplace.golang.go
«derivation /nix/store/ldx15dnxwd1sa3gb2lvs1rl4v0f5cq11-vscode-extension-golang-Go-0.37.1.drv»
nix-repl> inputs.nix-vscode-extensions.extensions.x86_64-linux.open-vsx.golang.go
«derivation /nix/store/sq3bm44dl8k1g1mm2daqix3ayjn289j2-vscode-extension-golang-Go-0.37.1.drv»
Alternatively, use an overlay (see overlays.default
in flake.nix).
Without flakes
This repo provides a default.nix
, so you can use, e.g.
(import (builtins.fetchGit {
url = "https://github.com/nix-community/nix-vscode-extensions";
ref = "refs/heads/master";
rev = "a1980daf16eb0d8acfb6e17953d3945bfdac9a4d";
})).extensions.x86_64-linux.vscode-marketplace.golang.go
Alternatively, you may use an overlay (see overlays.default
in flake.nix).
Contribute
Main flake
-
See the issues
-
(Optionally) Install direnv, e.g., via
nix profile install nixpkgs#direnv
. -
Run a devshell. When prompted about
extra-trusted-substituters
answery
. This is to use binary caches.nix develop nix-dev/
-
(Optionally) Start
VSCodium
with necessary extensions and toolsnix run nix-dev/#writeSettingsJson nix run nix-dev/#codium .
Haskell script
-
See the hs/README.md
-
Run a devshell. When prompted about
extra-trusted-substituters
answery
. This is to use binary caches.cd hs && nix develop
Troubleshooting
- If
VSCodium
doesn't pick up the extensions, try to reboot your computer and startVSCodium
again. - See troubleshooting.