Minecraft won't start :(

minecraft won’t start


q@NixOS:/etc/nixos/ > inxi -F
System:
  Host: NixOS Kernel: 6.11.5-zen1 arch: x86_64 bits: 64
  Desktop: Hyprland v: N/A Distro: NixOS 24.11 (Vicuna)
Machine:
  Type: Desktop Mobo: ASRock model: B650M PG Lightning
    serial: <superuser required> UEFI: American Megatrends LLC. v: 2.08
    date: 03/01/2024
CPU:
  Info: 6-core model: AMD Ryzen 5 8400F bits: 64 type: MT MCP cache: L2: 6 MiB
  Speed (MHz): avg: 1697 min/max: 400/4757 cores: 1: 400 2: 2999 3: 400
    4: 3000 5: 400 6: 2977 7: 400 8: 2999 9: 2999 10: 2996 11: 400 12: 400
Graphics:
  Device-1: NVIDIA GP107 [GeForce GTX 1050 Ti] driver: nvidia v: 565.57.01
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.4
    compositor: Hyprland driver: gpu: nvidia,nvidia-nvswitch
    resolution: 1920x1080~60Hz
  API: EGL v: 1.5 drivers: nvidia,swrast
    platforms: gbm,wayland,x11,surfaceless,device
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 565.57.01
    renderer: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2
Audio:
  Device-1: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel
  Device-2: AMD Family 17h/19h HD Audio driver: snd_hda_intel
  API: ALSA v: k6.11.5-zen1 status: kernel-api
  Server-1: PipeWire v: 1.2.5 status: active
Network:
  Device-1: Realtek RTL8125 2.5GbE driver: r8169
  IF: enp6s0 state: up speed: 1000 Mbps duplex: full mac: 9c:6b:00:5e:1b:66
Drives:
  Local Storage: total: 927.81 GiB used: 69.33 GiB (7.5%)
  ID-1: /dev/nvme0n1 vendor: Lexar model: SSD NM620 256GB size: 238.47 GiB
  ID-2: /dev/sda vendor: Seagate model: ST3500413AS size: 465.76 GiB
  ID-3: /dev/sdb vendor: Patriot model: Burst size: 223.57 GiB
Partition:
  ID-1: / size: 216.66 GiB used: 69.26 GiB (32.0%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-2: /boot size: 511 MiB used: 63.4 MiB (12.4%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: zram size: 15.25 GiB used: 0 KiB (0.0%) dev: /dev/zram0
  ID-2: swap-2 type: partition size: 16.77 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p3
Sensors:
  Src: /sys System Temperatures: cpu: 27.9 C mobo: 25.0 C
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 15.25 GiB used: 5.97 GiB (39.1%)
  Processes: 264 Uptime: 0h 15m Shell: Zsh inxi: 3.3.35
{
  description = "я флейк, а ты?";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
    alejandra.url = "github:kamadorueda/alejandra/3.1.0";
    hyprland.url = "github:hyprwm/Hyprland";
    hypr-contrib.url = "github:hyprwm/contrib";
    hyprpicker.url = "github:hyprwm/hyprpicker";
    hyprmag.url = "github:SIMULATAN/hyprmag";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    spicetify-nix = {
      url = "github:gerg-l/spicetify-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    home-manager,
    nixpkgs-stable,
    ...
  } @ inputs: let
    user = "q";
    host = "NixOS";
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      config.allowUnfree = true;
    };
    stable = import nixpkgs-stable {
      inherit system;
      config.allowUnfree = true;
    };
  in {
    nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
      system = system;
      modules = [
        ({
          config,
          pkgs,
          lib,
          ...
        }: {
          xdg.portal = {
            enable = true;
            xdgOpenUsePortal = true;
            wlr.enable = true;
            config.common.default = "*";
            extraPortals = with pkgs; [
              xdg-desktop-portal
              xdg-desktop-portal-wlr
            ];
          };

          boot = {
            consoleLogLevel = 3;
            tmp.cleanOnBoot = true;
            plymouth.enable = true;
            loader = {
              timeout = 2;
              systemd-boot.enable = true;
              efi.canTouchEfiVariables = true;
            };
            extraModprobeConfig = ''
              options nvidia-drm modeset=1
            '';
            kernelParams = [
              "nvidia.NVreg_UsePageAttributeTable=1"
              "nvidia.NVreg_PreserveVideoMemoryAllocations=1"
              "nvidia_drm.modeset=1"
            ];
            kernelModules = [
              "nvidia"
              "nvidia_modeset"
              "nvidia_uvm"
              "nvidia_drm"
            ];
            blacklistedKernelModules = ["nouveau"];
            kernelPackages = pkgs.linuxPackages_zen;
          };

          hardware = {
            graphics = {
              enable = true;
              extraPackages = with pkgs; [
                nvidia-vaapi-driver
                vaapiVdpau
                mesa
                mesa.drivers
                vdpauinfo
                vulkan-tools
                vulkan-loader
                libva
              ];
            };
            pulseaudio.enable = false;
            nvidia = {
              modesetting.enable = true;
              powerManagement.enable = true;
              open = false;
              nvidiaSettings = true;
              package = config.boot.kernelPackages.nvidiaPackages.beta;
            };
            enableRedistributableFirmware = true;
          };

          nixpkgs = {
            hostPlatform = "x86_64-linux";
            overlays = [
            ];
            config = {
              allowUnfree = true;
              allowBroken = true;
              cudaSupport = true;
              allowInsecure = false;
              packageOverrides = pkgs: {};
              permittedInsecurePackages = [
              ];
            };
          };

          security = {
            sudo = {
              enable = true;
              execWheelOnly = true;
              extraConfig = ''
                Defaults targetpw
              '';
            };
            rtkit.enable = true;
            polkit.enable = true;
          };

          services = {
            logind.extraConfig = ''
              # don’t shutdown when power button is short-pressed
              # HandlePowerKey=ignore
            '';

            ollama = {
              enable = true;
              acceleration = "cuda";
            };

            fstrim.enable = true;

            greetd = {
              enable = true;
              settings = {
                default_session = {
                  command = ''
                    ${pkgs.greetd.tuigreet}/bin/tuigreet \
                           --time \
                    --user-menu \
                    --time-format '%I:%M %p | %a • %h | %F' \
                    --cmd Hyprland
                  '';
                  user = "greeter";
                };
              };
            };

            gpm.enable = true;

            displayManager = {
              ly = {
                enable = false;
              };
              autoLogin = {
                enable = false;
                user = "${user}";
              };
            };

            clamav = {
              scanner.enable = true;
              updater.enable = true;
              fangfrisch.enable = true;
              daemon.enable = true;
            };

            printing = {
              enable = true; # Включает систему печати CUPS
              webInterface = true; # Включает веб-интерфейс CUPS
              startWhenNeeded = true; # Запускает CUPS при необходимости
              openFirewall = true; # Открывает порт для доступа к CUPS из сети
              browsing = true; # Включает автоматический поиск принтеров в сети
              browsed.enable = true; # Включает дополнительный сервис для поиска принтеров
              drivers = [pkgs.cnijfilter_4_00]; # Указывает драйвер для принтера
            };

            libinput.enable = true;
            dbus.enable = true;
            gvfs.enable = true;

            pipewire = {
              enable = true;
              audio.enable = true;
              jack.enable = true;
              wireplumber.enable = true;
              alsa.enable = true;
              alsa.support32Bit = true;
              pulse.enable = true;
            };

            xserver = {
              enable = true;
              videoDrivers = ["nvidia"];
            };
          };

          users = {
            defaultUserShell = pkgs.zsh;
            users = {
              ${user} = {
                description = "Marian";
                isNormalUser = true;
                extraGroups = [
                  "wheel"
                  "input"
                  "lp"
                  "libvirtd"
                ];
                hashedPassword = "$y$j9T$Zkw4AsRu8Om.xr/FoKJRz1$rATrla8D9I7lOagPp76BWHcCa1DHBi.uHOlYuKa0W21";
              };
            };
          };

          programs = {
            thefuck.enable = true;
            dconf.enable = true;
            xwayland.enable = true;
            nano.enable = false;
            hyprland = {
              enable = true;
              xwayland.enable = true;
            };
            zsh = {
              enable = true;
              syntaxHighlighting.enable = true;
              autosuggestions.enable = true;
              enableCompletion = true;
              histSize = 10000;
              enableLsColors = true;
            };

            steam = {
              enable = true;
              protontricks.enable = true;
              remotePlay.openFirewall = true;
              localNetworkGameTransfers.openFirewall = true;
              dedicatedServer.openFirewall = true;
            };

            nh = {
              enable = true;
              clean = {
                enable = true;
                extraArgs = "--keep-since 7d --keep 5";
              };
              flake = "/etc/nixos";
            };
          };

          networking = {
            hostName = "${host}";
            networkmanager.enable = true;
            nat = {
              enable = true;
              externalInterface = "enp6s0";
              internalInterfaces = ["wg0"];
            };
            firewall = {
              allowedUDPPorts = [21121];
            };
          };

          zramSwap = {
            enable = true;
            algorithm = "lz4";
            memoryPercent = 100;
            priority = 999;
          };

          systemd = {
            oomd.enable = true;
          };

          time.timeZone = "Europe/Kiev";

          i18n = {
            defaultLocale = "en_US.UTF-8";
            extraLocaleSettings = {
              LC_ADDRESS = "uk_UA.UTF-8";
              LC_IDENTIFICATION = "uk_UA.UTF-8";
              LC_MEASUREMENT = "uk_UA.UTF-8";
              LC_MONETARY = "uk_UA.UTF-8";
              LC_NAME = "uk_UA.UTF-8";
              LC_NUMERIC = "uk_UA.UTF-8";
              LC_PAPER = "uk_UA.UTF-8";
              LC_TELEPHONE = "uk_UA.UTF-8";
              LC_TIME = "uk_UA.UTF-8";
            };
          };

          nix = {
            settings = {
              experimental-features = ["nix-command" "flakes"];
              auto-optimise-store = true;
              allowed-users = ["${user}"];
              warn-dirty = true;
              substituters = ["https://nix-gaming.cachix.org"];
              trusted-public-keys = [
                "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
              ];
            };
          };
          fonts = {
            fontconfig.enable = true;
            packages = with pkgs; [
              noto-fonts
              noto-fonts-cjk-sans
              noto-fonts-emoji
              liberation_ttf
              proggyfonts
              pixel-code
              overpass
              terminus_font
              iosevka
              spleen
              tewi-font
              roboto
              creep
              unifont
              zpix-pixel-font
              nerdfonts
              jetbrains-mono
              font-awesome
            ];
          };
          system.stateVersion = config.system.nixos.release;
        })
        home-manager.nixosModules.home-manager
        {
          home-manager = {
            extraSpecialArgs = {inherit stable;};
            useGlobalPkgs = true;
            useUserPackages = true;
            users.${user} = {
              stable,
              config,
              pkgs,
              lib,
              ...
            }: {
              imports = [
                inputs.spicetify-nix.homeManagerModules.default
                inputs.hyprland.homeManagerModules.default
              ];
              home = {
                username = "${user}";
                homeDirectory = "/home/${user}";
                stateVersion = "24.05";
                sessionVariables = {
                  MOZ_ENABLE_WAYLAND = "1";
                  QT_QPA_PLATFORM = "xcb";
                  NIXOS_OZONE_WL = "1";
                  __GL_GSYNC_ALLOWED = "0";
                  __GL_VRR_ALLOWED = "0";
                  _JAVA_AWT_WM_NONEREPARENTING = "1";
                  DISABLE_QT5_COMPAT = "0";
                  GDK_BACKEND = "wayland";
                  WLR_DRM_NO_ATOMIC = "1";
                  QT_AUTO_SCREEN_SCALE_FACTOR = "1";
                  QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
                  QT_QPA_PLATFORMTHEME = "qt5ct";
                  QT_STYLE_OVERRIDE = "kvantum";
                  WLR_BACKEND = "vulkan";
                  WLR_RENDERER = "vulkan";
                  LIBVA_DRIVER_NAME = "nvidia";
                  GBM_BACKEND = "nvidia-drm";
                  WLR_NO_HARDWARE_CURSORS = "1";
                  XDG_SESSION_TYPE = "wayland";
                  SDL_VIDEODRIVER = "wayland";
                  GTK_THEME = "Gruvbox-Green-Dark";
                  __GLX_VENDOR_LIBRARY_NAME = "nvidia";
                  __GLX_RENDERER = "nvidia";
                  STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
                };
                packages = with pkgs;
                  [
                    inputs.alejandra.defaultPackage.${system}
                    inputs.hypr-contrib.packages.${system}.grimblast
                    pavucontrol
                    okular
                    vlc
                    pipes-rs
                    ani-cli
                    gtt
                    imv
                    ncdu
                    nitch
                    unzip
                    cbonsai
                    cmatrix
                    sl
                    tty-clock
                    libreoffice
                    hexdump
                    eza
                    nix-tree
                    go
                    pulsemixer
                    vesktop
                    gitkraken
                    killall
                    libnotify
                    w3m
                    tiv
                    fbida
                    minecraft
                    heroic
                    bottles
                    protonup-ng
                    mesa-demos
                    hyprpicker
                    sublime
                    megacmd
                    tor-browser
                    xorg.xev
                    zenity
                    fastfetch
                    neofetch
                    aichat
                    inxi
                    rofi-wayland
                    tree
                    wpsoffice
                    telegram-desktop
                    zram-generator
                    nvtopPackages.nvidia
                    fd
                    xfce.thunar
                  ]
                  ++ (with stable; [
                    grapejuice
                  ]);
              };

              wayland.windowManager.hyprland = let
                runOnce = program: "pgrep ${program} || ${program}";
              in {
                enable = true;
                systemd.enable = true;
                settings = {
                  general = {
                    "$mod0" = "SUPER";
                    border_size = 1;
                    no_border_on_floating = true;
                    gaps_in = 0;
                    gaps_out = 0;
                    gaps_workspaces = 0;
                    "col.inactive_border" = "rgba(000000ff)";
                    "col.active_border" = "rgba(ffffffff)";
                  };
                  decoration = {
                    inactive_opacity = 1.0;
                    blur.enabled = false;
                    shadow.enabled = false;
                  };
                  input = {
                    kb_layout = "us,ru";
                    kb_options = "grp:alt_shift_toggle";
                    numlock_by_default = true;
                    resolve_binds_by_sym = true;
                    repeat_rate = 40;
                    repeat_delay = 200;
                    sensitivity = 1.0;
                    accel_profile = "flat"; #flat/adaptive
                    force_no_accel = true;
                    left_handed = false; # смена кнопок мыши местами
                    scroll_method = "on_button_down";
                    scroll_factor = 1.0;
                    emulate_discrete_scroll = 2;
                  };
                  group = {
                    focus_removed_window = false;
                    "col.border_active" = "rgba(ffffffff)";
                    "col.border_inactive" = "rgba(000000ff)";
                    groupbar = {
                      height = 1;
                      render_titles = false;
                      "col.active" = "rgba(ffffffff)";
                      "col.inactive" = "rgba(000000ff)";
                    };
                  };
                  misc = {
                    initial_workspace_tracking = 2;
                    middle_click_paste = false;
                  };
                  animations.enabled = false;
                  monitor = [
                    "HDMI-A-1,1920x1080@60,0x0,1"
                  ];
                  bindm = [
                    "$mod0, mouse:272, movewindow"
                    "$mod0, mouse:273, resizewindow"
                  ];
                  bind = [
                    "$mod0, Return, exec, kitty"
                    "ALT, Return, exec, [float; center; size 950 650] kitty"
                    "$mod0, Q, killactive,"
                    "$mod0, D, exec, rofi -show drun || pkill rofi#"
                    "$mod0, F, togglefloating,"
                    "$mod0, X, togglesplit,"
                    "$mod0, P,exec, hyprpicker -a"
                    ", Print, exec, ${runOnce "grimblast"} --notify copysave screen"
                    "$mod0, Print, exec, ${runOnce "grimblast"} --notify copysave active"
                    "SHIFT, Print, exec, ${runOnce "grimblast"} --notify copysave area"

                    "$mod0, G, togglegroup"
                    "$mod0 SHIFT, G, moveoutofgroup, l"
                    "$mod0, tab, changegroupactive, f"
                    "$mod0, T, lockactivegroup,toggle"
                    "$mod0 SHIFT, tab, changegroupactive ,b"

                    "$mod0, left, movefocus, l"
                    "$mod0, right, movefocus, r"
                    "$mod0, up, movefocus, u"
                    "$mod0, down, movefocus, d"

                    "$mod0 SHIFT, left, movewindow, l"
                    "$mod0 SHIFT, right, movewindow, r"
                    "$mod0 SHIFT, up, movewindow, u"
                    "$mod0 SHIFT, down, movewindow, d"

                    "$mod0 CTRL, left, resizeactive, -80 0"
                    "$mod0 CTRL, right, resizeactive, 80 0"
                    "$mod0 CTRL, up, resizeactive, 0 -80"
                    "$mod0 CTRL, down, resizeactive, 0 80"

                    "$mod0 ALT, left, moveactive, -80 0"
                    "$mod0 ALT, right, moveactive, 80 0"
                    "$mod0 ALT, up, moveactive, 0 -80"
                    "$mod0 ALT, down, moveactive, 0 80"

                    "$mod0, 1, workspace, 1"
                    "$mod0, 2, workspace, 2"
                    "$mod0, 3, workspace, 3"
                    "$mod0, 4, workspace, 4"
                    "$mod0, 5, workspace, 5"
                    "$mod0, 6, workspace, 6"
                    "$mod0, 7, workspace, 7"
                    "$mod0, 8, workspace, 8"
                    "$mod0, 9, workspace, 9"
                    "$mod0, 0, workspace, 10"

                    "$mod0 SHIFT, 1, movetoworkspacesilent, 1"
                    "$mod0 SHIFT, 2, movetoworkspacesilent, 2"
                    "$mod0 SHIFT, 3, movetoworkspacesilent, 3"
                    "$mod0 SHIFT, 4, movetoworkspacesilent, 4"
                    "$mod0 SHIFT, 5, movetoworkspacesilent, 5"
                    "$mod0 SHIFT, 6, movetoworkspacesilent, 6"
                    "$mod0 SHIFT, 7, movetoworkspacesilent, 7"
                    "$mod0 SHIFT, 8, movetoworkspacesilent, 8"
                    "$mod0 SHIFT, 9, movetoworkspacesilent, 9"
                    "$mod0 SHIFT, 0, movetoworkspacesilent, 10"
                  ];
                };
              };

              qt = {
                enable = true;
              };

              services = {
                mako = {
                  enable = true;
                  font = "unifont";
                  backgroundColor = "#000000";
                };
              };
              programs = {
                qutebrowser.enable = true;
                mpv.enable = true;
                cava.enable = true;
                obs-studio.enable = true;
                vscode = {
                  enable = true;
                  package = pkgs.vscode-fhs;
                  extensions = with pkgs.vscode-extensions; [
                    golang.go
                    github.copilot
                    github.copilot-chat
                    svelte.svelte-vscode
                    ecmel.vscode-html-css
                    ms-ceintl.vscode-language-pack-ru
                  ];
                };

                bat = {
                  enable = true;
                  config = {
                    pager = "less -FR";
                    theme = "gruvbox-dark";
                  };
                  extraPackages = with pkgs.bat-extras; [
                    batman
                    batpipe
                    batgrep
                    # batdiff
                  ];
                };

                neovim = {
                  enable = true;
                  viAlias = true;
                  vimAlias = true;
                  defaultEditor = true;
                };

                btop = {
                  enable = true;
                  settings = {
                    color_theme = "TTY";
                    theme_background = false;
                    update_ms = 100;
                  };
                };

                fzf = {
                  enable = true;
                  enableZshIntegration = true;
                };

                git = {
                  enable = true;
                  userName = "";
                  userEmail = "";
                };

                gh = {
                  enable = true;
                };

                spicetify = let
                  spicePkgs =
                    inputs.spicetify-nix.legacyPackages.${pkgs.system};
                in {
                  enable = false;
                  theme = spicePkgs.themes.catppuccin;
                  colorScheme = "mocha";

                  enabledExtensions = with spicePkgs.extensions; [
                    adblock
                    hidePodcasts
                    shuffle
                  ];
                };

                zoxide = {
                  enable = true;
                  enableZshIntegration = true;
                };

                firefox.enable = true;

                kitty = {
                  enable = true;

                  font = {
                    name = "JetBrainsMono Nerd Font";
                    size = 9;
                  };

                  settings = {
                    confirm_os_window_close = 0;
                    window_padding_width = 0;
                    scrollback_lines = 10000;
                    enable_audio_bell = false;
                    mouse_hide_wait = 60;
                  };
                };
              };

              xdg = {
                userDirs = {
                  enable = true;
                  createDirectories = true;
                  extraConfig = {
                    XDG_VSC_DIR = "${config.home.homeDirectory}/vscode";
                    XDG_SCR_DIR = "/home/q/.config/scripts";
                  };
                };
              };
            };
          };
        }
        ./hardware-configuration.nix
      ];
    };
  };
}

According to the Wiki, Minecraft versions >= 1.19 won’t work with the official launcher. I don’t know why 1.18 failed as well, but I recommend you use one of the alternative launchers listed in the wiki instead.

2 Likes

thanks for the answer, i’ll try

1 Like

both versions of minecraft are launched through the prism launcher but there are mini freezes when moving the camera

You might be having performance issues. Try enabling gamemode and see if the freezes disappear: Settings > Minecraft > Tweaks > Performance > Enable Feral GameMode

If that doesn’t help, there are also certain performance modpacks that you can try like GitHub - Fabulously-Optimized/fabulously-optimized: A simple Minecraft modpack focusing on performance and graphics enhancements. which I highly recommend.

This is the modlist of what that modpack installs in case you’re curious or if you only want to install specific ones: fabulously-optimized/INCLUDED-MODS.md at 39038bf22d9060e86db1ac962936aa8ad44b94d6 · Fabulously-Optimized/fabulously-optimized · GitHub

3 Likes

Thanks, I managed to install the modpack and the game runs smoothly, but I couldn’t activate Feral in the launcher. Is there a way to launch a specific version through Fabulously? It defaults to 1.21 for me

1 Like

Okay, I found how to launch the desired version in Fabulously.

It should be enabled by default since your system is Linux. Perhaps you can try enabling it system-wide with programs.gamemode.enable = true;, but you don’t really have to do this since the game is running smoothly.

2 Likes

The reason 1.19+ don’t start is that the official launcher bundles some native libraries that aren’t linked for NixOS (older versions bundled a pure Java version of the game engine).

The error here is quite different. Doesn’t mean that I know any better what’s going on, and PrismLauncher works so it’s probably safe to ignore… Just wanted to give some context for reference.

1 Like