Adds a build-support function: fetchPackwizModpack.
It uses FOD (fixed output derivation) to fetch an entire Packwiz pack, given its pack.toml URL.
You can then easily use the symlinks and files options to put mods, configs, and anything else the pack provides, in a granular way.
There's also two cool other features:
The built modpack exports a manifest attribute, that is the pack.toml imported as a Nix expr. This lets you, for example, get the MC and Fabric version your server should run.
This, by default, uses IFD (for convenience). They user may alternatively specify a manifestHash, which will then be used with builtins.fetchurl to avoid IFD.
There's also a addFiles attribute that lets you include/overwrite additional files on the modpack so, for example, you can add server-specific mods that the pack does not include.
An alternative is packwiz2nix. It's a smarter implementation but, as of now, it has some limitations that hurt its usability (curseforge does not work, modpacks must have additional hashes added, etc). In the future, when it's more mature and handles all use cases, this function could use packwiz2nix's implementation instead.
I've added documentation to it (hope we can improve documentation on other parts of the repo in the future, too!), but here's an additional usage example:
Adds a build-support function:
fetchPackwizModpack
.It uses FOD (fixed output derivation) to fetch an entire Packwiz pack, given its
pack.toml
URL.You can then easily use the
symlinks
andfiles
options to put mods, configs, and anything else the pack provides, in a granular way.There's also two cool other features:
manifest
attribute, that is thepack.toml
imported as a Nix expr. This lets you, for example, get the MC and Fabric version your server should run.manifestHash
, which will then be used withbuiltins.fetchurl
to avoid IFD.addFiles
attribute that lets you include/overwrite additional files on the modpack so, for example, you can add server-specific mods that the pack does not include.This fixes https://github.com/Infinidoge/nix-minecraft/issues/12
An alternative is
packwiz2nix
. It's a smarter implementation but, as of now, it has some limitations that hurt its usability (curseforge does not work, modpacks must have additional hashes added, etc). In the future, when it's more mature and handles all use cases, this function could usepackwiz2nix
's implementation instead.