System/modules/linux/programs/games.nix

74 lines
2.3 KiB
Nix

{ config, lib, pkgs, inputs, ... }:
let np = config.nathan.programs;
in with lib; {
config = mkIf np.games {
environment.systemPackages = let
# https://github.com/Admicos/minecraft-wayland
glfw-patched = pkgs.glfw-wayland.overrideAttrs (attrs: {
src = pkgs.fetchzip {
version = "3.4.0";
url =
"https://github.com/glfw/glfw/archive/62e175ef9fae75335575964c845a302447c012c7.tar.gz";
sha256 = "sha256-GiY4d7xadR0vN5uCQyWaOpoo2o6uMGl1fCcX4uDGnks=";
};
buildInputs = with pkgs;
with pkgs.xorg; [
wayland
wayland-protocols
libxkbcommon
libX11
libXrandr
libXinerama
libXcursor
libXi
libXext
];
patches = [
../../../patches/minecraft/0003-Don-t-crash-on-calls-to-focus-or-icon.patch
../../../patches/minecraft/0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch
../../../patches/minecraft/0005-Add-warning-about-being-an-unofficial-patch.patch
# ../../../patches/minecraft/0006-Don-t-crash-getting-scancode-name.patch
../../../patches/minecraft/0007-Platform-Prefer-Wayland-over-X11.patch
];
});
stable-packages = with pkgs; [
# Dwarf fortress
(dwarf-fortress-packages.dwarf-fortress-full.override {
enableFPS = true;
})
# Prism Launcher minecraft stuff
inputs.prismlauncher.packages."${system}".prismlauncher
glfw-patched
gamescope
];
unstable-packages =
with inputs.nixpkgs-unstable.legacyPackages."${pkgs.system}";
[
# Packwiz for maintaing modpacks
packwiz
];
in stable-packages ++ unstable-packages;
# Install steam
programs.steam.enable = true;
# Make steam work with gamescope
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
gtk3
];
};
};
};
}