nixpkgs/pkgs/development/tools/electron/binary/default.nix
Eelco Dolstra 8d2a765adf Let-float various fromJSON calls to avoid repeated JSON reading/parsing
Some of these were read/parsed dozens of times in a `nix search`
invocation, and in particular the MELPA recipes archive (3 MiB) was
read 4 times.
2024-06-03 18:52:42 +02:00

15 lines
291 B
Nix

let
infoJson = builtins.fromJSON (builtins.readFile ./info.json);
in
{ lib, callPackage }:
let
mkElectron = callPackage ./generic.nix { };
in
lib.mapAttrs' (majorVersion: info:
lib.nameValuePair
"electron_${majorVersion}-bin"
(mkElectron info.version info.hashes)
) infoJson