Snowiiii / Pumpkin

Empowering everyone to host fast and efficient Minecraft servers.
https://snowiiii.github.io/Pumpkin/
MIT License
3.25k stars 113 forks source link

Nix flake #283

Open nicholaschiasson opened 1 week ago

nicholaschiasson commented 1 week ago

Description

Testing

N/A since there is no code change.

I simply ran nix run locally to test that it is working.

Checklist

Things need to be done before this Pull Request can be merged.

nicholaschiasson commented 6 days ago

For fastnbt dep, I understand now the reason it is necessary to pin the SHA in this flake is because the dependency is specified in a few Cargo.tomls using a git url. Is this because we need features not yet available in an official release (2.5.0), that are only in fastnbt master branch? And as a side question, is this a blocker before pumpkin itself can also have a stable release?

With this change, I have checked the Cargo.lock into version control, since that is the recommendation for rust projects that output binaries. The flake itself depends on the lock file as well, so it kind of makes the Cargo.lock file necessary. If that is problematic, then this change may be inappropriate for this repo. However, I think it will also help here. And for new contributors as well, since we guarantee people are getting the same versions of dependencies after a fresh repo clone.

If we ever wish to update the fastnbt dependency, the flake file will need to be updated too to reflect the new hash (tedious), or if we can pin against a new fastnbt release from the crates registry, we can remove the explicit pinning from the flake. That would be best because then there would be no hard coded versions in there and the file would rarely/never require further modification.

Snowiiii commented 6 days ago

We are currently moving to an own NBT Crate. Should be done soon. Only some issues with arrays when deserializing. https://github.com/Snowiiii/Pumpkin/pull/100