fix(flake.nix): added extra minecraft dependencies
expanded runtimeLibs in flake.nix with libXi, libXinerama, libGL (libglvnd), vulkan-loader, libxkbcommon, udev, alsa-lib, libpulseaudio, and appended /run/opengl-driver/lib for the Mesa drivers
This commit is contained in:
1 parent
a2d337397c
commit
59becfd7c9
1 file changed
+32
-12
@@ -13,19 +13,29 @@
|
|||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
flake-utils.lib.eachDefaultSystem (system: let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
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";
|
curseforgeApiKey = builtins.getEnv "CURSEFORGE_API_KEY";
|
||||||
# minecraft's bundled lwjgl natives dlopen the host's x11 stack, which
|
# minecraft's lwjgl/sdl natives dlopen the host's x11, opengl, vulkan,
|
||||||
# isn't on the default loader path on nixos. java is spawned as a child
|
# input and audio stack, which isn't on the default loader path on nixos.
|
||||||
# of rmcl, so a wrapper LD_LIBRARY_PATH propagates all the way down.
|
# java is spawned as a child of rmcl, so a wrapper LD_LIBRARY_PATH
|
||||||
runtimeLibs = pkgs.lib.makeLibraryPath (with pkgs; [
|
# propagates all the way down. /run/opengl-driver/lib holds the mesa
|
||||||
libX11
|
# drivers that libglvnd dispatches to.
|
||||||
libXext
|
runtimeLibs =
|
||||||
libXcursor
|
pkgs.lib.makeLibraryPath (with pkgs; [
|
||||||
libXrandr
|
libX11
|
||||||
libXxf86vm
|
libXext
|
||||||
]);
|
libXcursor
|
||||||
|
libXrandr
|
||||||
|
libXxf86vm
|
||||||
|
libXi
|
||||||
|
libXinerama
|
||||||
|
libGL
|
||||||
|
vulkan-loader
|
||||||
|
libxkbcommon
|
||||||
|
udev
|
||||||
|
alsa-lib
|
||||||
|
libpulseaudio
|
||||||
|
])
|
||||||
|
+ ":/run/opengl-driver/lib";
|
||||||
in {
|
in {
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||||
pname = "rmcl";
|
pname = "rmcl";
|
||||||
@@ -50,5 +60,15 @@
|
|||||||
mainProgram = "rmcl";
|
mainProgram = "rmcl";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# `nix develop` + `cargo run --release` spawns java directly, bypassing
|
||||||
|
# the wrapper above, so expose the same runtime libs in the dev shell.
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [cargo rustc rustfmt clippy jdk pkg-config];
|
||||||
|
buildInputs = [pkgs.libxcb];
|
||||||
|
shellHook = ''
|
||||||
|
export LD_LIBRARY_PATH="${runtimeLibs}:$LD_LIBRARY_PATH"
|
||||||
|
'';
|
||||||
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user