tlaternet-server/lib/minecraft.nix

31 lines
610 B
Nix
Raw Normal View History

{ lib, pkgs, ... }:
{
# Make a modpack given its mod inputs.
#
# Mods should be attrsets in this format:
# {
# project = "";
# id = "";
# filename = "";
# sha256 = "";
# }
#
# This may be nice to read from a json ;)
#
mkModpack = { name, version, mods }:
pkgs.stdenv.mkDerivation {
inherit name version;
srcs = map pkgs.local.fetchFromCurseForge mods;
sourceRoot = "src/";
preUnpack = "mkdir -p src/";
unpackCmd = "cp $curSrc src/";
installPhase = ''
mkdir -p $out/mods/
cp * $out/mods
'';
};
}