67 lines
1.1 KiB
Nix
67 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
bootstrap,
|
|
...
|
|
}:
|
|
|
|
{
|
|
packUrl,
|
|
gameVersion,
|
|
loaderUid,
|
|
loaderVersion,
|
|
}:
|
|
|
|
pkgs.stdenvNoCC.mkDerivation {
|
|
name = "minecraft-client";
|
|
|
|
dontUnpack = true;
|
|
|
|
mmcpack = ''
|
|
{
|
|
"components": [
|
|
{
|
|
"important": true,
|
|
"uid": "net.minecraft",
|
|
"version": "${gameVersion}"
|
|
},
|
|
{
|
|
"uid": "${loaderUid}",
|
|
"version": "${loaderVersion}"
|
|
}
|
|
],
|
|
"formatVersion": 1
|
|
}
|
|
'';
|
|
|
|
instancecfg = pkgs.writeText "instance.cfg" ''
|
|
[General]
|
|
ConfigVersion=1.2
|
|
InstanceType=OneSix
|
|
OverrideCommands=true
|
|
PreLaunchCommand=\"$INST_JAVA\" -jar packwiz-installer-bootstrap.jar ${packUrl}
|
|
'';
|
|
|
|
buildPhase = ''
|
|
# Remove env-vars
|
|
rm env-vars
|
|
|
|
# Add the mmc-pack
|
|
echo $mmcpack > ./mmc-pack.json
|
|
|
|
# Add the instance-cfg
|
|
cp $instancecfg ./instance.cfg
|
|
|
|
# Add the bootstrap jar
|
|
mkdir ./minecraft
|
|
cp ${bootstrap} ./minecraft/packwiz-installer-bootstrap.jar
|
|
|
|
# Zip everything together
|
|
${pkgs.zip}/bin/zip -r modpack.zip ./*
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir $out
|
|
mv modpack.zip $out/
|
|
'';
|
|
}
|