Working Minecraft Setup

This commit is contained in:
LarsZauberer 2024-04-21 22:04:36 +02:00
commit 9d83d95186
3 changed files with 12 additions and 40 deletions

View file

@ -3,7 +3,7 @@ _: {
../../../options/boot/grub-boot.nix
../../../options/desktop/fonts.nix
../../../options/common/networking.nix
../../../options/common/gpu/nvidia.nix
../../../options/common/gpu/nvidia_wayland.nix
../../../options/common/pin-registry.nix
../../../options/common/preserve-system.nix
../../../options/common/bluetooth.nix

View file

@ -1,41 +1,12 @@
{ config, inputs, pkgs, lib, ... }:
{ config, lib, pkgs, ... }:
let
username = config.modules.other.system.username;
# Fetch the GLFW with Wayland patches for Minecraft
customGLFW = let
mcWaylandPatchRepo = pkgs.fetchFromGitHub {
owner = "Admicos";
repo = "minecraft-wayland";
rev = "370ce5b95e3ae9bc4618fb45113bc641fbb13867";
sha256 = "sha256-RPRg6Gd7N8yyb305V607NTC1kUzvyKiWsh6QlfHW+JE=";
};
mcWaylandPatches = map (name: "${mcWaylandPatchRepo}/${name}")
(lib.naturalSort (builtins.attrNames (lib.filterAttrs
(name: type:
type == "regular" && lib.hasSuffix ".patch" name)
(builtins.readDir mcWaylandPatchRepo))));
in pkgs.glfw.overrideAttrs (previousAttrs: {
patches = previousAttrs.patches ++ mcWaylandPatches;
buildInputs = previousAttrs.buildInputs ++ [ pkgs.wayland ];
});
# Minecraft launcher with the custom GLFW
minecraftPrismLauncher = pkgs.prismlauncher.override {
glfw = customGLFW;
};
in {
home-manager.users.${username} = {
home.packages = let
fenix = inputs.fenix.packages.${pkgs.system};
in with pkgs; [
];
};
# System-wide installation of Minecraft PrismLauncher
environment.systemPackages = [
minecraftPrismLauncher
];
in
{
environment.systemPackages = with pkgs; [
prismlauncher
glfw-wayland-minecraft # Use these parameters in the prism launcher: -Dfml.earlyprogresswindow=false -Dorg.lwjgl.glfw.libname=/nix/store/ypkdx5844pp1vdw2z2nmnf2nb9kgl0mp-glfw-wayland-minecraft-unstable-2023-06-01/lib/libglfw.so
mmex
];
}

View file

@ -6,6 +6,7 @@
WLR_NO_HARDWARE_CURSORS = "1";
LIBVA_DRIVER_NAME = "nvidia";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
__GL_THREADED_OPTIMIZATIONS=0;
};
environment.systemPackages = with pkgs; [
vulkan-loader