-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
developmentStandard developmentStandard development
Description
Specification
Hi, i just learned from your repository how to put the electron squirrel windows installer bundling process into the nix sandbox. Thank you very much for sharing!
From reading the code, i assume that you generated the list of zip downloads from the checksums.js file from the electron folder manually. In order to facilitate updates, i automated this process. I don't know if there are specific reasons other than lack of time for you to not automate this, but nonetheless i decided to leave the snippet here in case someone (you or other readers of the code in this repo) may find it useful:
electronZipBundle = nodeDeps:
let
items = builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile "${nodeDeps}/lib/node_modules/electron/checksums.json"));
itemNames = builtins.attrNames items;
electronMatch = builtins.match "electron-(v[0-9.]*)-([a-z0-9]+)-([a-z0-9]+)\.zip";
electronItemNames = builtins.filter (x: electronMatch x != null) itemNames;
f = k:
let
matches = electronMatch k;
version = builtins.elemAt matches 0;
sha256 = items.${k};
path = pkgs.fetchurl {
url = "https://github.com/electron/electron/releases/download/${version}/${k}";
inherit sha256;
};
in
{
inherit (path) name;
inherit path;
};
in
pkgs.linkFarm "electron-zip-dir" (builtins.map f electronItemNames);Metadata
Metadata
Assignees
Labels
developmentStandard developmentStandard development