diff --git a/hosts/lars/kronos/configuration.nix b/hosts/lars/kronos/configuration.nix index cd91bec..40e90e7 100644 --- a/hosts/lars/kronos/configuration.nix +++ b/hosts/lars/kronos/configuration.nix @@ -18,6 +18,11 @@ enable = true; gamescope = true; }; + + minecraft = { + enable = true; + wayland = true; + }; }; hyprland = { diff --git a/hosts/lars/kronos/programs.nix b/hosts/lars/kronos/programs.nix index ad01a4d..3341de5 100644 --- a/hosts/lars/kronos/programs.nix +++ b/hosts/lars/kronos/programs.nix @@ -1,11 +1,6 @@ { config, lib, pkgs, ... }: -let - -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 ]; } diff --git a/modules/gui/default.nix b/modules/gui/default.nix index ff880a6..9d5dc81 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -15,5 +15,6 @@ _: { ./alacritty.nix ./firefox.nix ./steam.nix + ./minecraft.nix ]; } diff --git a/modules/gui/minecraft.nix b/modules/gui/minecraft.nix new file mode 100644 index 0000000..72c4aa7 --- /dev/null +++ b/modules/gui/minecraft.nix @@ -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 + ]; + }; + }; +} diff --git a/options/common/gpu/nvidia_wayland.nix b/options/common/gpu/nvidia_wayland.nix index e4856fb..2dcd218 100644 --- a/options/common/gpu/nvidia_wayland.nix +++ b/options/common/gpu/nvidia_wayland.nix @@ -6,7 +6,6 @@ WLR_NO_HARDWARE_CURSORS = "1"; LIBVA_DRIVER_NAME = "nvidia"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - __GL_THREADED_OPTIMIZATIONS=0; }; environment.systemPackages = with pkgs; [ vulkan-loader