nix-community / nix-vscode-extensions

Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
MIT License
169 stars 9 forks source link

Improve documentation? #29

Closed DrymarchonShaun closed 1 year ago

DrymarchonShaun commented 1 year ago

I'm trying to figure out how I would go about integrating this into my home-manager configuration and the documentation/examples given in the readme doesn't seem to explain it.

Ideally I'd like to be able to use this with programs.vscode.extensions in home-manager, (I do have programs.vscode.package set to pkgs.vscodium).

deemp commented 1 year ago

@AmeerTaweel, I have no experience with home-manager. Could you please help?

DrymarchonShaun commented 1 year ago

I think I figured it out. I wasn't familar with how overlays work, and the readme doesn't elaborate on where they get added.

Not nicely formatted for it to be put directly in documentation, but what I had do to was:

add the input to flake.nix - This is covered

  inputs = {
  # ...
    # VSCodium Extensions
    nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
  };

Then in my home-manager config (location is very user dependent) I added the overlay to nixpkgs - I think this is how the overlay is used in a regular configuration as well. This is the main part that confused me and I don't think is covered.

nixpkgs = {
     overlays = [
      # ...

      inputs.nix-vscode-extensions.overlays.default
    ];
    config = {
       # ...
    };
  };

And then I was able to just add vscode-marketplace onto with pkgs;


 programs.vscode = {
    enable = true;
    package = pkgs.vscodium;
      extensions = with pkgs.vscode-marketplace; [
    # Make sure these are lowercase! 
           pinage404.nix-extension-pack
           # ...
      ];
  };

EDITED: Grammar

deemp commented 1 year ago

@DrymarchonShaun , I added an Overlay section to the README. Is the README straightforward now?

DrymarchonShaun commented 1 year ago

yeah, thats fine.

nixos-discourse commented 6 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/unable-to-add-vscode-extensions-with-home-manager/37956/1