feat(nix): curseforge key env support

gave flake support for adding own CURSEFORGE_API_KEY at build time; updated README.md with new details
This commit is contained in:
GitanElyon committed 2026-09-29 12:08:53 -04:00
1 parent 3525c7b69c
commit 04c92f17bf
2 files changed
+22

No files matched your search

+7
View File
@@ -13,6 +13,9 @@
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
# release binaries have the curseforge key compiled in; source builds
# don't, so forward the caller's key when building impurely.
curseforgeApiKey = builtins.getEnv "CURSEFORGE_API_KEY";
# minecraft's bundled lwjgl natives dlopen the host's x11 stack, which
# isn't on the default loader path on nixos. java is spawned as a child
# of rmcl, so a wrapper LD_LIBRARY_PATH propagates all the way down.
@@ -32,6 +35,10 @@
nativeBuildInputs = [pkgs.jdk pkgs.makeWrapper];
buildInputs = [pkgs.libxcb];
env = pkgs.lib.optionalAttrs (curseforgeApiKey != "") {
CURSEFORGE_API_KEY = curseforgeApiKey;
};
postFixup = ''
wrapProgram $out/bin/rmcl --prefix LD_LIBRARY_PATH : ${runtimeLibs}
'';