Infinidoge / nix-minecraft

An attempt to better support Minecraft-related content for the Nix ecosystem
MIT License
172 stars 18 forks source link

add fetchPackwizModpack #35

Closed Misterio77 closed 1 year ago

Misterio77 commented 1 year ago

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:

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 use packwiz2nix's implementation instead.

Misterio77 commented 1 year ago

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:

https://github.com/Misterio77/nix-config/blob/2936608/hosts/celaeno/services/minecraft/servers/modpack/default.nix

Misterio77 commented 1 year ago

Thanks for the feedback!