Codium flake
June 5, 2023 ยท View on GitHub
Set up VSCodium with extensions and executables on its PATH in several lines of Nix code
See Prerequisites
Conventions
In a project with multiple subprojects, one needs to switch between toolsets for each subproject.
In some cases, it's convenient to start several VSCodium instances, one per sub-project.
Then, one needs to decide how to deliver VSCodium in such a project. There are several options.
- A single
VSCodiumwith a superset of required extensions and executables on itsPATHover the sub-projects. - A
VSCodiumper sub-project - A mix of these
Contribute
nix develop
codium .
Troubleshooting
Missing extensions
Only one instance of VSCodium gets supplied extensions.
Close other instances of VSCodium before opening a new one.
GitHub Personal Access Token (PAT) for VS Codium extensions
- Create a
classicPAT with permissions:read:user, repo, user:email, workflow - Supply it to extensions
Missing binaries on PATH in VSCodium
Case: VSCodium doesn't have the binaries provided in runtimeDependencies (like here) on PATH:
- You need to repair VSCodium's derivation
- Assumptions:
Check:- Start VSCodium:
nix run .#codium . - Open a VSCodium terminal
echo $PATHthere- It doesn't contain
/bindirs of specifiedruntimeDependencies
- Start VSCodium:
- Close:
- devshells with this VSCodium
- VSCodium itself
- Remove direnv profiles:
cd DIR && rm -rf .direnv
- Open a new terminal,
cd DIR - Run
nix store repair .#codium - Make a
Check(see above) to verify binaries are onPATH - If still no, continue
- Restart your OS
nix store gc- collect garbage in Nix store - man- Again, make a
Check