2021-12-15 05:29:56 +00:00
|
|
|
{ callPackage, lib, javaPackages }:
|
2021-12-10 11:45:19 +00:00
|
|
|
let
|
|
|
|
versions = lib.importJSON ./versions.json;
|
2021-12-15 05:29:56 +00:00
|
|
|
|
2021-12-10 11:45:19 +00:00
|
|
|
latestVersion = lib.last (builtins.sort lib.versionOlder (builtins.attrNames versions));
|
2022-01-15 01:59:56 +00:00
|
|
|
escapeVersion = builtins.replaceStrings [ "." ] [ "-" ];
|
2021-12-10 11:45:19 +00:00
|
|
|
|
2021-12-15 05:29:56 +00:00
|
|
|
getJavaVersion = v: (builtins.getAttr "openjdk${toString v}" javaPackages.compiler).headless;
|
|
|
|
|
2021-12-10 11:45:19 +00:00
|
|
|
packages = lib.mapAttrs'
|
|
|
|
(version: value: {
|
2022-01-15 01:59:56 +00:00
|
|
|
name = "vanilla-${escapeVersion version}";
|
2021-12-15 05:29:56 +00:00
|
|
|
value = callPackage ./derivation.nix {
|
|
|
|
inherit (value) version url sha1;
|
|
|
|
jre_headless = getJavaVersion (if value.javaVersion == null then 8 else value.javaVersion); # versions <= 1.6 will default to 8
|
|
|
|
};
|
2021-12-10 11:45:19 +00:00
|
|
|
})
|
|
|
|
versions;
|
|
|
|
in
|
2022-01-15 01:59:56 +00:00
|
|
|
lib.recurseIntoAttrs (
|
|
|
|
packages // {
|
|
|
|
vanilla = builtins.getAttr "vanilla-${escapeVersion latestVersion}" packages;
|
|
|
|
}
|
|
|
|
)
|