From 39341af6b0e79563211d643ed388ea5e3d7587cd Mon Sep 17 00:00:00 2001 From: Majiir Paktu Date: Mon, 16 Jan 2023 16:22:01 -0500 Subject: [PATCH] papermc: allow version override --- pkgs/games/papermc/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/games/papermc/default.nix b/pkgs/games/papermc/default.nix index 66754073db5c..930b4462a7bd 100644 --- a/pkgs/games/papermc/default.nix +++ b/pkgs/games/papermc/default.nix @@ -1,14 +1,16 @@ { lib, stdenv, fetchurl, bash, jre }: -let - mcVersion = "1.19.3"; - buildNum = "375"; - jar = fetchurl { + +stdenv.mkDerivation rec { + pname = "papermc"; + version = "1.19.3.375"; + + jar = let + mcVersion = lib.versions.pad 3 version; + buildNum = builtins.elemAt (lib.versions.splitVersion version) 3; + in fetchurl { url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar"; sha256 = "sha256-NAl4+mCkO6xQQpIx2pd9tYX2N8VQa+2dmFwyBNbDa10="; }; -in stdenv.mkDerivation { - pname = "papermc"; - version = "${mcVersion}r${buildNum}"; preferLocalBuild = true;