depot/third_party/nixpkgs/pkgs/games/papermc/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

17 lines
576 B
Nix

let
versions = builtins.fromJSON (builtins.readFile ./versions.json);
in
{ callPackage, lib, ... }:
let
latestVersion = lib.last (builtins.sort lib.versionOlder (builtins.attrNames versions));
escapeVersion = builtins.replaceStrings [ "." ] [ "_" ];
packages = lib.mapAttrs'
(version: value: {
name = "papermc-${escapeVersion version}";
value = callPackage ./derivation.nix { inherit (value) version hash; };
})
versions;
in
lib.recurseIntoAttrs (packages // {
papermc = builtins.getAttr "papermc-${escapeVersion latestVersion}" packages;
})