Visual Studio Code: How to install remote-containers plugin?

I’m trying to use the VS Code Remote Containers extension on NixOS. The extension gets installed, but it remains greyed out / disabled. I’m wondering how I could get it to work.

image

To install it, I’ve added the following to my environment.systemPath:

let
  extensions = (with pkgs.vscode-extensions; [
    github.vscode-pull-request-github
    editorconfig.editorconfig
    ms-python.python
    ms-azuretools.vscode-docker
    ms-vscode-remote.remote-ssh
    esbenp.prettier-vscode
    dbaeumer.vscode-eslint
    eamodio.gitlens
  ]) ++ (pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
    name = "remote-containers";
    publisher = "ms-vscode-remote";
    version = "0.193.0";
    sha256 = "0nkhavww18c5v656i17pl4ih67qv5l46s0dlflrmy55k79arc26k";
  }]);
in
pkgs.vscode-with-extensions.override {
  vscodeExtensions = extensions;
}

This roughly follows the VS Code guide in the NixOS wiki.

1 Like

Edit: nevermind, I see this is mentioned at the bottom of the wiki page you linked.


I don’t use vscode and don’t know the answer, but I recently noticed there’s a second vscode in the Nix repos called vscode-fhs, a wrapped version that launches a Linux filesystem hierarchy environment to make extensions easier to install. Have you tried it with that version?

1 Like

Did you have any joy getting this to work @blitz ?

I’m back at using Emacs. :smiley: But if you run into the same problem, I would give @bgibson’s advice a shot and try vscode-fhs.

Thanks blitz.

This is exactly what I ended up doing in the end. Yet to reverse engineer what’s actually needed to work the “nix way” but it got me past a sticky spot!