misc/vscode-extensions: improve scripts for updating VSC extensions#113280
misc/vscode-extensions: improve scripts for updating VSC extensions#113280cideM wants to merge 1 commit intoNixOS:masterfrom
Conversation
25c6047 to
19ec7b1
Compare
19ec7b1 to
3d41ca2
Compare
|
I also need to make sure that the other shell scripts are called relative to the first file, not relative to the working directory. Or maybe it's OK to use relative paths here as long as it's mentioned in the Wiki and the script itself |
That should be documented in here https://github.com/NixOS/nixpkgs/tree/master/doc/languages-frameworks |
|
Haven't forgotten was just busy over the weekend, will do the necessary changes over the next couple of days |
311bef0 to
26aac62
Compare
|
I had a change of heart and decided to remove the existing script which lists installed extensions. After extracting the other bit it became apparent that listing extensions is a bit of bash when the user can just call I also added documentation, as was asked. I took some cues from the existing info in the Wiki: Please let me know if that's in the right direction 🙏 |
SuperSandro2000
left a comment
There was a problem hiding this comment.
The examples are quite long. Maybe they could be reduced to the parts that matter for that section?
doc/languages-frameworks/vsc.md
Outdated
There was a problem hiding this comment.
Linking lines will likely break in the future.
There was a problem hiding this comment.
Hm yeah that's a good point I'll take that out
|
Not sure why the manual fails to build. |
26aac62 to
4f66b75
Compare
|
I updated the PR. I removed all line links. I also overhauled the documentation so it has less superfluous code snippets and gets to the point a bit quicker. Hopefully fixed doc build by giving the file a valid name |
c4736e5 to
df4e075
Compare
It did. |
|
Please also add an entry to https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/index.xml and yourself as a codeowner for |
df4e075 to
12360bc
Compare
|
|
Accidentally removed the branch from my fork |
|
@jonringer can you take a look at this? |
jonringer
left a comment
There was a problem hiding this comment.
otherwise looks mostly good to moe
|
@cideM @jonringer I'll integrate #121583 with this commit after this PR is merged. Please take a look at that PR then. |
The current update_installed_exts.sh always assumes that you're trying update all installed extensions. That makes it hard to use the get_vsixpkg function in a different setting. This commit removes listing extensions, since it's trivial for a user to run `code --list-extensions` but keeps and modifies the update script, so it's more flexible. Documentation was added to explain how the script works and explain VSC in Nix(OS) in general. The actual code is mostly the same.
12360bc to
c58e9d3
Compare
|
@jonringer I renamed the attribute that was sort of shadowing the package and I also added a paragraph about your FHS changes. It's somewhat duplicated from the Wiki but I'm in general unsure what goes where with regards to Wiki and the official documentation. i also rearranged some headings to make the different modes of operation a bit more clear. You can ultimately use Nix or the VSC UI and I think that's gonna be the most important question people have, so it should be easy to find. |
|
ping @jonringer (or should I ping someone else?) |
|
I think this now conflicts with #127741. We should probably have merged this long ago, sorry |
|
Ah no worries, I'll just close this one then and see if the documentation changes can help with the other PR at least |
This PR is a bit out of the blue but I've added my motivation for it under the appropriate heading. It was a fairly spontaneous thing that came up when I was migrating from controlling VSC extensions with VSC to Nix.
Motivation for this change
The current
update_installed_exts.shscript does several things. It tries to find the Visual Studio Code (VSC) binary (although it misses-insiders), and then it lists the extensions and prints a Nix object for each extensions which contains the updated version and sha. The idea is that it makes it easy to migrate to having extensions controlled with Nix.Unfortunately this makes it hard to reuse the functionality in that script in other settings. What if I just want to update a single extension?
I thought it would be nice to just separate the two concerns. As such I've created two separate scripts which are used in the
update_installed_exts.shscript, so that it's 100% backwards compatible. The newupdate_exts.shscript makes it easier to e.g., pipe the name of an extension to it.Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)