2024-05-22 14:29:45 +02:00
{
config ,
lib ,
inputs ,
pkgs ,
. . .
} :
with lib ; let
2024-04-22 21:43:37 +02:00
username = config . modules . other . system . username ;
cfg = config . modules . programs . minecraft ;
in {
options . modules . programs . minecraft = {
enable = mkEnableOption " m i n e c r a f t " ;
wayland = mkEnableOption " w a y l a n d " ;
} ;
config = mkIf cfg . enable {
# Set wayland environment flag
2024-05-15 00:14:59 +02:00
environment . variables =
2024-05-22 14:29:45 +02:00
mkIf cfg . wayland { __GL_THREADED_OPTIMIZATIONS = 0 ; } ;
2024-04-22 21:43:37 +02:00
# Install glfw-wayland-minecraft
2024-05-15 00:14:59 +02:00
environment . systemPackages = with pkgs ;
mkIf cfg . wayland [
2024-04-22 21:43:37 +02:00
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
2024-05-15 00:14:59 +02:00
] ;
2024-04-22 21:43:37 +02:00
home-manager . users . ${ username } = {
# Install minecraft
2024-05-22 14:29:45 +02:00
home . packages = with pkgs ; [ prismlauncher ] ;
2024-04-22 21:43:37 +02:00
} ;
} ;
}