Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Installing extensions in Project IDX using dev.nix configuration file - not working

Could you help me with Project IDX. Version: 1.89.1. Browser: Chrome.
I want to have googlecloudtools.cloudcode extension installed using dev.nix configuration file. I have dev.nix like this:

 

{ pkgs, ... }: 
{
  channel = "stable-24.05";
  packages = [
    pkgs.python313
  ];
  idx.extensions = [
      "googlecloudtools.cloudcode"
  ];
}

 

Unfortunatelly, this command does not install this extension at initialization environment phase of Project IDX startup what I observe on the Extensions list where "Gemini Code Assist + Google Cloud Code" has to be still installed.

Masagero_0-1734976132069.png

The same is happening to other extensions I tried.
Meanwhile the package python313 installs correctly, what I can check from Terminal.
No errors show up during IDX startup.

I don't want workarounds (I found them) but I just want to understand how dev.nix works or does not work.

One of workaround is to use Extension Panel on the left in IDX UI and there find and install "Gemini Code Assist + Google Cloud Code" manually.

Another workaround is to delay the extension installation by using a post-initialization script (env parameter) in dev.nix file (--install-extension googlecloudtools.cloudcode after a short delay). This works, but still this is the workaround for me.

Gemini sent me to official Project IDX documentation and support channels for the most accurate and up-to-date information.

Here I am. Is it possible to have extension installed using idx.extensions parameter in dev.nix file? And if so, what am I missing?

Solved Solved
0 1 852
1 ACCEPTED SOLUTION

Hi @Masagero,

Welcome to Google Cloud Community!

Project IDX doesn't use the standard VS Code extension installation mechanism. It has its own system for managing extensions within its cloud environment. This is likely why your direct attempt using idx.extensions in the dev.nix file isn't working at the initialization phase.

You are likely missing:

  • Correct Extension Management Configuration: The parameter idx.extensions might be a hint for Project IDX internal management but still require another parameter or a specific way to trigger installation during environment setup, especially in existing workspaces. There may also be other ways how extension management is handled in IDX not related to dev.nix.
  • Missing Trigger Mechanism: It looks like Project IDX does not trigger the install during environment initialization based on the parameter idx.extensions alone.

To answer your question, if it is possible to install with idx.extensions, based on your experience and known limitations with the current version of Project IDX the short answer is: No, it's not possible in the way you're currently trying to do it.

Here are some recommendations that you may find useful:

  1. Embrace the Post-Initialization Script Approach: While you consider this a workaround, it's the supported way, for now, to have extensions automatically installed when starting a workspace. This indicates that this might be the official solution in a current version of Project IDX, or at least one of the ways for such functionality.
  2. Monitor Official Documentation: Keep an eye on the official Project IDX documentation, release notes and Project IDX troubleshooting & FAQ. The situation with idx.extensions might change in future updates.
  3. Contact Project IDX Support: This can also be considered, since the current functionality seems to be unclear on documentation.
  4. Consider Project IDX Feedback: The Project IDX may be under heavy development, and your feedback about dev.nix functionality is valuable to the team to improve it.

In summary,  while it seems intuitive that idx.extensions should install extensions, it appears this parameter is not designed for this purpose yet. Using a post-initialization script with the projectidx CLI tool for installing extensions is the best approach to achieve automated installation of extensions in your environment, at least in the current version of Project IDX.

Also, I found a similar case that you may check and could be useful for you.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

View solution in original post

1 REPLY 1

Hi @Masagero,

Welcome to Google Cloud Community!

Project IDX doesn't use the standard VS Code extension installation mechanism. It has its own system for managing extensions within its cloud environment. This is likely why your direct attempt using idx.extensions in the dev.nix file isn't working at the initialization phase.

You are likely missing:

  • Correct Extension Management Configuration: The parameter idx.extensions might be a hint for Project IDX internal management but still require another parameter or a specific way to trigger installation during environment setup, especially in existing workspaces. There may also be other ways how extension management is handled in IDX not related to dev.nix.
  • Missing Trigger Mechanism: It looks like Project IDX does not trigger the install during environment initialization based on the parameter idx.extensions alone.

To answer your question, if it is possible to install with idx.extensions, based on your experience and known limitations with the current version of Project IDX the short answer is: No, it's not possible in the way you're currently trying to do it.

Here are some recommendations that you may find useful:

  1. Embrace the Post-Initialization Script Approach: While you consider this a workaround, it's the supported way, for now, to have extensions automatically installed when starting a workspace. This indicates that this might be the official solution in a current version of Project IDX, or at least one of the ways for such functionality.
  2. Monitor Official Documentation: Keep an eye on the official Project IDX documentation, release notes and Project IDX troubleshooting & FAQ. The situation with idx.extensions might change in future updates.
  3. Contact Project IDX Support: This can also be considered, since the current functionality seems to be unclear on documentation.
  4. Consider Project IDX Feedback: The Project IDX may be under heavy development, and your feedback about dev.nix functionality is valuable to the team to improve it.

In summary,  while it seems intuitive that idx.extensions should install extensions, it appears this parameter is not designed for this purpose yet. Using a post-initialization script with the projectidx CLI tool for installing extensions is the best approach to achieve automated installation of extensions in your environment, at least in the current version of Project IDX.

Also, I found a similar case that you may check and could be useful for you.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.