Infinidoge / nix-minecraft

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

Datapack Management not possible with Current Symlink Implementation #34

Closed cappuccinocosmico closed 1 year ago

cappuccinocosmico commented 1 year ago

Problem: The folder for datapacks resides in /world/datapacks. Since the links created by with servers.<name>.symlinks results is defined to be the name of a variation and it is impossible to include special characters in the name of a derivation. My first immediate workaround trying create a symlink in the entire /worlds folder being a read only symbolic link to the nix store, thus making it impossible for the server to generate the world.

Fix: It would be nice to have a system for directly managing datapacks, or a modification to the current method of defining symlinks to get this to work. :)

cappuccinocosmico commented 1 year ago

This might be solvable using this recent pull request: https://github.com/Infinidoge/nix-minecraft/pull/29 but based on my understanding of the code it only works with text files.

Misterio77 commented 1 year ago

Hey, can you show an example? Does this not work for you?

{
  services.minecraft-servers.servers.foo = {
    symlinks = {
      "world/datapacks/fóóbãr.zip" = a-derivation;
    };
  };
}
cappuccinocosmico commented 1 year ago

My apologies, my previous config had mistakenly tried to apply

{
  services.minecraft-servers.servers.foo = {
    symlinks = {
      "world/datapacks/fóóbãr.zip".value = a-derivation;
    };
  };
}

With that change everything is working perfectly :) Thanks for the help!