use jq for vscode extention rewrite

This commit is contained in:
nyxerinys 2026-07-21 04:36:33 -05:00
parent adc4490673
commit 1d8018a463

View file

@ -7,15 +7,18 @@
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pkgs.vscodium.overrideAttrs (oldAttrs: { (pkgs.vscodium.overrideAttrs (oldAttrs: {
nativeBuildInputs = (oldAttrs.nativeBuildInputs or []) ++ [ pkgs.jq ];
postInstall = (oldAttrs.postInstall or "") + '' postInstall = (oldAttrs.postInstall or "") + ''
substituteInPlace $out/Applications/VSCodium.app/Contents/Resources/app/product.json \ productJson=$out/Applications/VSCodium.app/Contents/Resources/app/product.json
--replace '"extensionsGallery": {}' '"extensionsGallery": { tmp=$(mktemp)
"serviceUrl": "https://visualstudio.com", jq '.extensionsGallery = {
"cacheUrl": "https://windows.net", serviceUrl: "https://marketplace.visualstudio.com/_apis/public/gallery",
"itemUrl": "https://visualstudio.com", cacheUrl: "https://vscode.blob.core.windows.net/gallery/index",
"controlUrl": "https://msecnd.net", itemUrl: "https://marketplace.visualstudio.com/items",
"recommendationsUrl": "https://visualstudio.com/recommendations" controlUrl: "",
}' recommendationsUrl: ""
}' "$productJson" > "$tmp"
mv "$tmp" "$productJson"
''; '';
})) }))
git git