feat: Add configuration option for popularity data URL

This commit is contained in:
Vincent Ambo 2019-09-21 12:15:38 +01:00 committed by Vincent Ambo
parent e4d03fdb17
commit 64f74abc4d
5 changed files with 12 additions and 5 deletions

View file

@ -35,6 +35,9 @@
# layers. To allow for some extensibility (via additional layers),
# the default here is set to something a little less than that.
maxLayers ? 96,
# Popularity data for layer solving is fetched from the URL passed
# in here.
popularityUrl ? "https://storage.googleapis.com/nixery-layers/popularity/popularity-19.03.173490.5271f8dddc0.json",
...
}:
@ -101,10 +104,7 @@ let
fetched = (map (deepFetch pkgs) (fromJSON packages));
in foldl' splitter init fetched;
popularity = builtins.fetchurl {
url = "https://storage.googleapis.com/nixery-layers/popularity/nixos-19.03-20190812.json";
sha256 = "16sxd49vqqg2nrhwynm36ba6bc2yff5cd5hf83wi0hanw5sx3svk";
};
popularity = builtins.fetchurl popularityUrl;
# Before actually creating any image layers, the store paths that need to be
# included in the image must be sorted into the layers that they should go

View file

@ -22,7 +22,7 @@
# all arguments of build-image.nix.
, srcType ? "nixpkgs"
, srcArgs ? "nixos-19.03"
, tag ? null, name ? null, packages ? null, maxLayers ? null
, tag ? null, name ? null, packages ? null, maxLayers ? null, popularityUrl ? null
}@args:
let pkgs = import ./load-pkgs.nix { inherit srcType srcArgs; };