New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add vscodeWithConfiguration, vscodeExts2nix, vscodeEnv #76624
Conversation
…nd vscodeEnv move mktplcExtRefToFetchArgs to file in order to be shared with the new derivations(privately)
… vscodeExts2nix, vscodeEnv change usage of toPath with toString
Just a rough look so far but this looks like a |
@eadwu I might not completely understand your comment(feel free to correct me) but in general: |
@@ -0,0 +1,40 @@ | |||
#use vscodeWithConfiguration and vscodeExts2nix to create vscode exetuable that when exits(vscode) will update the mutable extension file, which is imported when getting evaluated by nix. | |||
{ pkgs ? import <nixpkgs> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really see the point of re-importing nixpkgs
here, most of the things here are already given (besides vscode-utils.extensionsFromVscodeMarketplace
) which could be easily added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
#removed not defined extensions | ||
rmExtensions = lib.optionalString (nixExtensions++mutableExtensions != []) '' | ||
find ${vscodeExtsFolderName} -mindepth 1 -maxdepth 1 ${lib.concatMapStringsSep " " (e : ''! -iname ${e.publisher}.${e.name}'') (nixExtensions++mutableExtensions)} -exec sudo rm -rf {} \; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know how I feel about the fact sudo
has to be used here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I don't like it too, any better idea for syncing the extensions folder (we need to be consistent with the nix expression when vscode starts) ?
cpExtensions = '' | ||
${lib.concatMapStringsSep "\n" (e : ''ln -sfn ${e}/share/vscode/extensions/* ${vscodeExtsFolderName}/'') nixExtsDrvs} | ||
${lib.concatMapStringsSep "\n" (e : '' | ||
cp -a ${e}/share/vscode/extensions/${e.vscodeExtUniqueId} ${vscodeExtsFolderName}/${e.vscodeExtUniqueId}-${(lib.findSingle (ext: ''${ext.publisher}.${ext.name}'' == e.vscodeExtUniqueId) "" "m" mutableExtensions ).version} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cp -a
keeps the directory permissions the same, so the extension directory wouldn't be mutable no? The extension directory permissions for me are 555 (dr-xr-xr-x
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me on drawin it solved the permission problem on the csharp extension. but maybe it is not the same on a different OS. will changing permissions make sense?
outdated look at PR #76427 |
move mktplcExtRefToFetchArgs to file in order to be shared with the new derivations(privately)
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @jonringer @zimbatm
fix based on @zimbatm comments in #76427