Minecraft config

This commit is contained in:
LarsZauberer 2024-04-22 21:43:37 +02:00
commit 46a14640c7
5 changed files with 34 additions and 6 deletions

View file

@ -18,6 +18,11 @@
enable = true; enable = true;
gamescope = true; gamescope = true;
}; };
minecraft = {
enable = true;
wayland = true;
};
}; };
hyprland = { hyprland = {

View file

@ -1,11 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
in
{ {
environment.systemPackages = with pkgs; [ 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
]; ];
} }

View file

@ -15,5 +15,6 @@ _: {
./alacritty.nix ./alacritty.nix
./firefox.nix ./firefox.nix
./steam.nix ./steam.nix
./minecraft.nix
]; ];
} }

28
modules/gui/minecraft.nix Normal file
View file

@ -0,0 +1,28 @@
{ config, lib, inputs, pkgs, ... }:
with lib; let
username = config.modules.other.system.username;
cfg = config.modules.programs.minecraft;
in {
options.modules.programs.minecraft = {
enable = mkEnableOption "minecraft";
wayland = mkEnableOption "wayland";
};
config = mkIf cfg.enable {
# Set wayland environment flag
environment.variables = mkIf cfg.wayland {
__GL_THREADED_OPTIMIZATIONS=0;
};
# Install glfw-wayland-minecraft
environment.systemPackages = with pkgs; mkIf cfg.wayland [
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
];
home-manager.users.${username} = {
# Install minecraft
home.packages = with pkgs; [
prismlauncher
];
};
};
}

View file

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