In my home.nix, I have a pattern like the below. I’d like to be able to update all extensions to the latest version with minimal hassle. Right now I (1) go to https://marketplace.visualstudio.com/ (2) search package (3) copy new version number and replace last three chars in hash with 000 (4) home-manager switch (5) copy new wanted SHA (6) repeat 4 & 5 for each package. Anyone have a better workflow? This is painfully slow and laborious. update-nix-fetchgit but not sure it’ll work with extensionsFromVscodeMarketplace.
Tried my hand at writing a script. Originally idea was to run this with nix-build and use traceSeq. Right now I get an error: error: value is a function while a set was expected. Any tips on how to make this a real script? Although I’ve packaged quite a few things at this point, I’m still clueless when it comes to the nix language. Many thanks!
let
pkgs = import <nixpkgs>;
extensions = [
{
name = "language-purescript";
publisher = "nwolverson";
version = "0.2.1";
sha256 = "18n35wp55c6k1yr2yrgg2qjmzk0vhz65bygfdk0z2p19pa4qhxzs";
}
{
name = "ide-purescript";
publisher = "nwolverson";
version = "0.20.8";
sha256 = "16avxmb1191l641r6pd99lw2cgq8gdfipb9n7d0czx1g9vfjr3ip";
}
];
mktplcExtRefToFetchArgs = ext: {
url = "https://${ext.publisher}.gallery.vsassets.io/_apis/public/gallery/publisher/${ext.publisher}/extension/${ext.name}/${ext.version}/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage";
# The `*.vsix` file is in the end a simple zip file. Change the extension
# so that existing `unzip` hooks takes care of the unpacking.
name = "${ext.publisher}-${ext.name}.zip";
};
fetchVsixFromVscodeMarketplace = mktplcExtRef:
pkgs.fetchurl((mktplcExtRefToFetchArgs mktplcExtRef));
in
pkgs.forEach extensions (x: fetchVsixFromVscodeMarketplace)