Skip to content

bug: profiles.default.extensions regression after commit b593765 (extension path changes) #8793

@helgeu

Description

@helgeu

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Related Issues

This appears to be a regression that worsened #7880. See also #7719 and #3507.

Issue description

After updating home-manager past commit b59376563943ce163b2553aeb63d0c170967d74e (Feb 1, 2026 - "vscode: fix extension path for antigravity"), extensions defined under profiles.default.extensions are no longer recognized by VS Code, even though they are correctly symlinked.

Before the update (home-manager d055b309... from Jan 23): Extensions worked
After the update (home-manager 436b2774... from Feb 21, includes the commit): Extensions not loaded

Steps to Reproduce

  1. Use profiles.default.extensions in vscode config
  2. Run darwin-rebuild switch (or home-manager switch)
  3. Open VS Code
  4. Run code --list-extensions - shows only manually installed extensions

Actual Output

$ code --list-extensions
github.copilot-chat  # Only 1 of 9 declared extensions

$ ls ~/.vscode/extensions/
.extensions-immutable.json -> /nix/store/...  # Correctly symlinked
Ionide.Ionide-fsharp -> /nix/store/...        # Correctly symlinked
ms-vscode.PowerShell -> /nix/store/...        # Correctly symlinked
# ... all 9 extensions present as symlinks

$ cat ~/.vscode/extensions/.obsolete
{"ionide.ionide-fsharp-7.31.1":true,"ms-vscode.powershell-2025.4.0":true,...}
# VS Code marks them all obsolete

Symptoms

  1. Extensions are correctly symlinked in ~/.vscode/extensions/
  2. .extensions-immutable.json is correctly generated with all extensions
  3. VS Code's extensions.json only recognizes manually installed extensions
  4. .obsolete file marks all Nix-managed extensions as obsolete
  5. code --list-extensions shows only manually installed extensions

Configuration

programs.vscode = {
  enable = true;
  profiles.default.userSettings = { ... };
  profiles.default.extensions = with pkgs; [
    vscode-extensions.ionide.ionide-fsharp
    vscode-extensions.ms-dotnettools.csdevkit
    vscode-extensions.jnoortheen.nix-ide
    vscode-extensions.ms-vscode.powershell
    vscode-extensions.github.copilot-chat
    # ... more extensions
  ];
};

Root Cause Analysis

The commit b59376563943ce163b2553aeb63d0c170967d74e changed extension path handling:

  • Removed the sharePrefix variable
  • Changed paths from "${sharePrefix}/extensions" to hardcoded "/share/vscode/extensions"
  • Modified how .extensions-immutable.json is generated

This change, intended to fix antigravity support, appears to have broken the extension loading mechanism for regular VS Code on Darwin when using profiles.default.extensions.

Workarounds

Workaround 1 (from #7880): Use legacy extensions option with mutableExtensionsDir = false:

programs.vscode = {
  enable = true;
  mutableExtensionsDir = false;
  extensions = [ ... ];  # Instead of profiles.default.extensions
  profiles.default.userSettings = { ... };
};

Workaround 2 (from #7719): Delete VS Code state and rebuild (temporary fix, breaks again on next rebuild):

rm -rf ~/.vscode ~/Library/Application\ Support/Code
darwin-rebuild switch  # or home-manager switch

System information

- system: `"aarch64-darwin"`
- host os: `Darwin 25.3.0, macOS 26.3`
- multi-user?: `yes`
- sandbox: `no`
- nixpkgs: `d1c15b7d5806069da59e819999d70e1cec0760bf`
- home-manager: `436b27742c996b75e2baf8e835e3b3eae0c9fbd4`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions