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