Unable to add vscode extensions with home-manager

I found this comment, but I am still confused about overlays and how to use them.

Here is my config: flake.nix home.nix

The way I actually do it is a little more complex but essentially is an overlay that looks like:

_: pkgs:

  community-vscode-extensions = (import <community-vscode-extensions>).extensions.${pkgs.system}.forVSCodeVersion pkgs.vscodium.version;
  vscode-extensions = pkgs.vscode-extensions // {
    bierner.markdown-preview-github-styles = community-vscode-extensions.open-vsx.bierner.markdown-preview-github-styles;
    earshinov.permute-lines = community-vscode-extensions.open-vsx.earshinov.permute-lines;
    ybaumes.highlight-trailing-white-spaces = community-vscode-extensions.open-vsx.ybaumes.highlight-trailing-white-spaces;

Sorry, I am a newbie, and this looks even more complicated.

these topics might be useful VSCode extensions setup - #10 by Georges
Vscode extension overlay with home-manager - #7 by Zhen-hao

A general overview of overlays from the manual: Nixpkgs 23.11 manual | Nix & NixOS

forgive me if you’ve seen these links already

1 Like

Technically, I solved it somewhat: flake.nix home.nix

      modules = genericModules ++ [
        # ...
          nixpkgs.overlays = [
        # ...

Except… not exactly. Sometimes I get extensions, sometimes I don’t. Weird, but I keep poking.