papermc: fix version/hash overrides

Reintroduces the use of finalAttrs that was introduced in
d0bb02b106 and erroneously removed in
ef321a0ed6.
This commit is contained in:
Majiir Paktu 2024-03-17 16:44:35 -04:00
parent 2282f6f5e1
commit 85f544d85e
1 changed files with 5 additions and 5 deletions

View File

@ -1,18 +1,18 @@
{ lib, stdenvNoCC, fetchurl, makeBinaryWrapper, jre, version, hash }:
stdenvNoCC.mkDerivation {
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "papermc";
inherit version;
inherit version hash;
src =
let
version-split = lib.strings.splitString "-" version;
version-split = lib.strings.splitString "-" finalAttrs.version;
mcVersion = builtins.elemAt version-split 0;
buildNum = builtins.elemAt version-split 1;
in
fetchurl {
url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar";
inherit hash;
inherit (finalAttrs) hash;
};
installPhase = ''
@ -47,4 +47,4 @@ stdenvNoCC.mkDerivation {
maintainers = with lib.maintainers; [ aaronjanse neonfuz MayNiklas ];
mainProgram = "minecraft-server";
};
}
})