{"id":16343660,"url":"https://github.com/tlater/nix-minecraft-servers","last_synced_at":"2025-11-06T05:30:33.741Z","repository":{"id":90247663,"uuid":"458385373","full_name":"TLATER/nix-minecraft-servers","owner":"TLATER","description":"Nix flake that provides utilities for hosting minecraft servers","archived":false,"fork":false,"pushed_at":"2022-02-12T01:20:12.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-27T16:30:27.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TLATER.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-12T00:59:16.000Z","updated_at":"2024-07-22T04:39:47.000Z","dependencies_parsed_at":"2024-01-08T16:45:46.479Z","dependency_job_id":null,"html_url":"https://github.com/TLATER/nix-minecraft-servers","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"d7271c7db69a7195fd5399f779299580a5fbea48"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLATER%2Fnix-minecraft-servers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLATER%2Fnix-minecraft-servers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLATER%2Fnix-minecraft-servers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLATER%2Fnix-minecraft-servers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TLATER","download_url":"https://codeload.github.com/TLATER/nix-minecraft-servers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239484208,"owners_count":19646429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T00:25:19.125Z","updated_at":"2025-02-18T13:45:31.096Z","avatar_url":"https://github.com/TLATER.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nix-minecraft-servers\n\nManage Minecraft servers with [nix](https://nixos.org/)!\n\nThis is still WIP, almost none of the actual functionality is\nimplemented. Treat this as a kind of information dump with an initial\ndesign spec hidden in it.\n\nThis very explicitly will not implement anything for client-side\nuse. There are better user-facing interfaces, and a lot of these\nprojects rely on users downloading them via ad-displaying services.\n\nThis intends to make server management easier, which hopefully will\nhelp increase the number of users downloading mods via means approved\nby their upstreams.\n\n## Modloaders\n\n### Regarding forge\n\nForge is distributed as an installer, which downloads all kinds of\nlibraries when run. This is the definition of impure.\n\nLuckily, this distribution also includes a list of the libraries it\nwill download in a convenient JSON file. We can use this to determine\nwhat the installer will want to download, and provide the dependencies\nfor it before it attempts to do so (to my knowledge, this will skip\nthe download step; if not we can hopefully work with upstream to\nchange that, or patch the binary downstream).\n\nForge does kindly ask that the installation process is not automated,\nhowever this is specifically so that they can get users to visit their\ndownload page and display ads to them.\n\nWe will therefore **not** download the forge installer itself, and use\nnix' store-add feature, requiring users to download the installer at\nleast once themselves.\n\nThe intention is to keep a database of libraries required for each\nversion of forge, and match the version requested by a user against\nthis, then to download the required libraries and produce a derivation\nof running the forge installer in a directory with these\ndependencies. This will allow it to extract its own jar and patch\nMinecraft, resulting in download-less forge installation.\n\nUnfortunately, the Minecraft patching process appears to still be\nimpure, but at least all inputs will be accounted for (and *perhaps*\nthe MPC team will in the future solve their reproducibility issues).\n\n### Regarding fabric\n\nI have not yet hosted a server using this mod loader, so I have no\nexperience with it.\n\n## Regarding mods\n\nMods are generally hosted on\nhttps://www.curseforge.com/minecraft. While they are an integral\ncomponent of gameplay for most people still playing this game, them\nbeing tied to this platform is a bit problematic. curseforge is\npresumably unable to comfortably handle all the requests to their\nplatform, and therefore make it quite awkward to try and automatically\npull anything from there (their attempt at monetizing the platform\nthrough the \"twitch launcher\" probably doesn't help).\n\nYet this is exactly what we want to do. Mods come in two shapes,\neither as mod packs or as individual mod files. Here's how these are\nhandled:\n\n### Modpacks\n\nModpacks are pre-configured, pre-collected sets of mods. Think of them\nas analogous to Linux distributions. In theory, a manifest file format\nexists to define these modpacks that can be used to define the mods\nthat need to be installed, and it is distributed with a zip file\ncontaining \"overrides\" which add additional things like configuration\nfiles, server icons and scripts.\n\nConveniently, this is a json format! Inconveniently, it is entirely\nproprietary, with no public documentation, and the only real\nimplementation that can create or read these is an electron-based web\napp (the aforementioned \"twitch launcher\"). This means that, unless\nyou are curseforge you practically must have a personal twitch account\nand be using their \"twitch launcher\" to install modpacks (attempts of\nusing anything else may be thwarted by cloudflare).\n\nThis obviously doesn't work well on servers.\n\nIt seems that some people upstream noticed this as well, and a pattern\nemerges: Most (but not all) modpacks provide a second set of\npre-configured \"server\" directories, which simply contain a full,\nworking Minecraft server directory.\n\nConveniently, this puts the whole ordeal under a single download,\nwhich makes it easier to evade bans from cloudflare.\n\nInconveniently, these are entirely created to the modpack author's\nwhims. Some include software which explicitly cannot be redistributed\nthis way according to their licenses (e.g. the forge installer, which\nis present in almost all of these, but explicitly forbids\nredistribution because it has a special license from a group of\nMinecraft modders who write special tools to patch the Minecraft\nbinary so that Forge can hook into it; but themselves are\nproprietary). Some include BAT scripts to install and run the\nserver. Some include installers.\n\nAll of that is a long way to say that we are stuck with two incredibly\nproblematic formats for modpacks:\n\n#### manifest.json\n\nCurrently unsupported; Modpacks I am interested in don't use this, and\nI'm not keen on wading through this. However, some thoughts for a\npotential future implementation:\n\n- Manifests do not contain full download links, only project IDs\n- We cannot maintain purity and download files from links produced\n  after a `fetchurl`, especially if we want to avoid [IFD][IFD].\n- We *can* pre-download the manifest with a script, and keep it\n  downstream.\n\nRough algorithm might be:\n\n1. Add a new download script that:\n   - Extracts `manifest.json` from a modpack.\n   - Creates a json file with an array of (project, id, filename)\n     tuples as expected by `fetchModFromCurseForge`.\n     - [This example][api-example] of their \"API\" may help extract the\n       filename, which is not recorded in the manifest but required\n       for downloads.\n   - Also stores a reference to the original modpack so that we can\n     access the \"overrides\".\n2. Add a new library function that:\n   - Downloads all files in one of the above json files with\n     `fetchModFromCurseForge`.\n   - Allows user overrides with additional mods and arbitrary\n     configuration.\n   - Stitches all the above together into a proper Minecraft\n     directory, giving priority to user overrides.\n\n### \"Server files\"\n\nSince these are entirely arbitrary, there is not too much we can\ndo. We'll assume the following:\n\n- Some `forge-${version}-installer.jar` exists\n  - Again, yes, somehow modpacks redistribute this, both against the\n    licensing and forge's wishes.\n- Some `server.properties` exists\n- No `whitelist.json`, `ops.json` or `eula.txt` exist\n\nA proper installation therefore requires that we know the forge\nversion to be installed before the derivation is built, and inject the\ncorrect set of libraries before the download.\n\n---\n\n[api-example]: https://addons-ecs.forgesvc.net/api/v2/addon/238222\n[IFD]: https://nixos.wiki/wiki/Import_From_Derivation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlater%2Fnix-minecraft-servers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlater%2Fnix-minecraft-servers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlater%2Fnix-minecraft-servers/lists"}