I found that I can checkout nixpkgs repository and from the root of nixpkgs, do the following:
nix-build -A pkgs.vscode-extensions.dhall \
--out-link ~/.vscode/extensions/dhall
however the problem is that the actual plugin ends up inside it’s own extensions
folder:
~/.vscode/extensions/dhall/share/vscode/extensions/dhall.dhall-lang/
and unreachable from vscode. Then there is this hack, where you provide vscode as a nixos module, and you create an activation script:
system.activationScripts.fix-vscode-extensions = {
text = ''
EXT_DIR=${config.vscode.homeDir}/.vscode/extensions
mkdir -p $EXT_DIR
chown ${config.vscode.user}:users $EXT_DIR
for x in ${lib.concatMapStringsSep " " toString config.vscode.extensions}; do
ln -sf $x/share/vscode/extensions/* $EXT_DIR/
done
chown -R ${config.vscode.user}:users $EXT_DIR
'';
deps = [];
};
I guess it is possible to provide your own module like this, but my experience with nixpkgs and vscode, is that things break quite often, having it as part of
nixos-rebuild switch
often create problems.
It would be nice if it was possible to do some of these things manually, just using nix-build, also to test new packages and just update some of them at their own pace. Maybe flake is the solution. I haven’t had time to look into it yet.