NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.45k stars 12.94k forks source link

Ability to intermix impurely installed VSCode extensions with vscode-with-extensions/vscode-extensions.* packages #169126

Open PAI5REECHO opened 2 years ago

PAI5REECHO commented 2 years ago

Describe the bug

I'd like to be able to install Live Share without having to use vscode-with-extensions to explicitly declare all extensions the I use. Using vscode-with-extensions is extremely annoying, I don't want to have to restart my VSCode every time I install or remove an extensions. I prefer the impure way when they just work already. It'd be nice if I could just grab extensions that require fixes to work (like live share) from the vscode-extensions.* packages and use them in my current installation. For now I'm just getting the output path of the Live Share extension from Nixpkgs and symlinking it to my home folder:

$ env NIXPKGS_ALLOW_UNFREE=1 nix show-derivation --impure nixpkgs#vscode-extensions.ms-vsliveshare.vsliveshare | jq -r '.[].outputs.out.path'
/nix/store/gdj9l1pxgfy8zb9vycghijm5ahhpj1kz-vscode-extension-ms-vsliveshare-vsliveshare-1.0.5043
$ trash ~/.vscode/extensions/ms-vsliveshare.vsliveshare-*
$ ln -s /nix/store/gdj9l1pxgfy8zb9vycghijm5ahhpj1kz-vscode-extension-ms-vsliveshare-vsliveshare-1.0.5043/share/vscode/extensions/ms-vsliveshare.vsliveshare/ ~/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5527

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install Live Share
  2. Join collaboration session
  3. Observe error when running extension

Expected behavior

Should be able to use vscode-with-extensions in addition to plugins installed impurely

Notify maintainers

@jraygauthier @deviant @eadwu @synthetica @maxeaubrey @bobby285271

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.17.1, NixOS, 22.05 (Quokka), 22.05.20220330.710fed5`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.0pre20220401_bf48959`
 - channels(root): `"nixos"`
 - channels(somebody): `"hm-21.05.tar.gz, home-manager-21.05.tar.gz, nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos
jraygauthier commented 2 years ago

@PAI5REECHO : Already possible using #148235 draft PR (which I should eventually provide a cleaned up version of). This is what I use locally and it works fine. See downside of the approach as part of the PR.

PAI5REECHO commented 2 years ago

You're literally blessed Mr.

jraygauthier commented 2 years ago

Hi @PAI5REECHO , it might be worth it to keep the issue open (if you want) until we have a definitive solution merged. Previously mentioned is merely a far from ready to be merged draft PR.