Jump to content

Gaming

From Official NixOS Wiki
Revision as of 10:42, 12 September 2026 by Ghb (talk | contribs) (Added section on sources of possible performance improvements.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Emulating and launchers

Games can be run by different applications. Some are able to include libraries from different platforms.

Application Platform Description nixpkgs
Steam Steam Stable support for Windows games. Linux games often incompatible due to interoperating differences. steam steam-run steam-runtime steam-original steam-unwrapped steam-small
Lutris Epic Games, EA App, Flatpak, GOG, Humble Bundle, Steam, Ubisoft Connect, Wine lutris lutris-free lutris-unwrapped
Legendary & Rare Epic Games Rare is a GUI for Legendary. legendary-gl rare
Heroic Epic Games, GOG, Prime Gaming, Wine Supports gamepad navigation. Uses Legendary unlike Lutris. heroic heroic-unwrapped
Itch.io Itch.io itch
PPSSPP PSP emulation ppsspp
PCSX2 PS2 emulation
RPCS3 PS3 emulation Contains unfree blobs (PS3 firmware). rpcs3
RetroArch Retro games emulation
Wine & Bottles Windows emulation and software management wineWow64Packages winetricks bottles
Dosbox DOS emulation dosbox

List of games in Nixpkgs

Name Category Description nixpkgs
0 A.D. Strategy, Historical Historical real-time strategy game. available
Armagetron Advanced Arcade, Racing A multiplayer Tron-like lightcycle racing game. available
Battle for Wesnoth Strategy, Turn-based Turn-based strategy game with fantasy themes. available
Cataclysm: Dark Days Ahead Survival, Rogue-like Post-apocalyptic survival game. available
Chromium B.S.U. Arcade, Space Shooter Fast paced, arcade-style, top-scrolling space shooter. available
Dungeon Crawl Rogue-like, Adventure, Turn-based Open-source, single-player, role-playing roguelike game. available
Dwarf Fortress Simulation, Management, Rogue-like, Sandbox Single-player fantasy game with a randomly generated adventure world. available
Endless Sky Space simulation, RPG Explore a universe with different factions and ships. available
FreeCiv Strategy, Turn-based Civilization-building strategy game. available
FreeDink Adventure, RPG Free, portable and enhanced version of the Dink Smallwood game engine. available
FreeDoom FPS Free alternative to the Doom series. unavailable
GZDoom FPS A feature-centric port for all Doom engine games, based on ZDoom, adding an OpenGL renderer and powerful scripting capabilities. available
LinCity Simulation, Management City simulation game. available
LinCity-NG Simulation, Management City simulation game. available
Luanti Sandbox An open source voxel game engine. available
Mindustry Strategy, Sandbox Sandbox tower defense game. available
NetHack Rogue-like, RPG Rogue-like game. available
OpenMW RPG, Open world, Action-adventure Unofficial open source engine reimplementation of the game Morrowind. available
OpenRA Strategy, RTS Open-source implementation of Command & Conquer. available
OpenTTD Simulation, Management Business simulation game based on Transport Tycoon Deluxe. available
Shattered Pixel Dungeon Rogue-like, RPG Rogue-like dungeon crawler with pixel graphics. available
Simon Tatham's Portable Puzzle Collection Puzzle Simon Tatham's portable puzzle collection. available
Super Tux Platformer, Side-scroller Classic 2D jump'n run side-scroller game. available
SuperTuxKart Arcade, Racing Kart racing game (like Super Mario Kart) featuring Tux and friends. available
Tales of Maj'Eyal (ToME 4) Rogue-like, RPG, Turn-based Rogue-like focused on exploration of procedurally generated dungeons. available
The Dark Mod Stealth, FPS Stealth game inspired by the Thief series. pending pull request
The Powder Toy Sandbox Classic 'falling sand' physics sandbox game.Classic 2D jump'n run sidescroller game. available
Veloren RPG, Sandbox Multiplayer voxel RPG set in a procedurally generated world. available
Xonotic FPS, Arena shooter Fast-paced multiplayer shooter. available

Installing games

Workarounds

Games that aren't yet available in nixpkgs can be played by other means, including but not limited to:

  • steam-run as described in Steam or by installing it then running steam-run $GAME or steam-run ./$GAME.
  • programs.nix-ld = { enable = true; libraries = pkgs.steam-run.fhsenv.args.multiPkgs pkgs; }; to run nearly any binary by including all of the libraries used by Steam. (Source)
  • appimage-run as described in Appimage.
  • Distrobox to virtualize an OS that has a package for your game.

Renowned Explorers: International Society

Tested with version renowned_explorers_international_society_522_26056.sh from gog.com. It can be played with steam-run, but it needs some libraries that are not normally included in Steam's FHS environment. One way to solve this is to add an overlay:

  nixpkgs.overlays = [
    (self: super: {
      steam-run = (super.steam.override {
        extraLibraries = pkgs: with pkgs;
          [
            libxkbcommon
            mesa
            wayland
            (sndio.overrideAttrs (old: {
              postFixup = old.postFixup + ''
                ln -s $out/lib/libsndio.so $out/lib/libsndio.so.6.1
              '';
            }))
          ];
      }).run;
    })
  ];

Adding libxkbcommon, mesa, and wayland is straightforward. The game expects the shared library sdnio.so.6.1 to exist, so we need to create a symbolic link after the installation of sndio.

Possible performance optimisations

While NixOS should provide perfectly reasonable performance, there does exist a number of ways to increase gaming performance on existing hardware in the system. Do note however, that all of the below suggestions, only increase the number of generated frames per second by a margin. To achieve much greater performance, better hardware is usually needed.

Disabling kernel split-lock mitigation

In kernel version 6.2, split_lock_mitigate was added, in order to disable the punishment implemented in kernel version 5.19 for abusing the kernel's split locks[1]. Disabling split_lock_mitigate should see significant performance improvements, in the games affected by the split lock's "misery mode"[1][2]. The kernel parameter can be enabled, or disabled in the system's configuration.nix.

boot.kernelParams = [
  # Split lock mitigation disabled.
  "split_lock_mitigate=0"
];

Enabling GameMode

Enabling GameMode should also yield some performance improvement. How to install and enable GameMode is described its' wiki page. Please note, that by default, GameMode disables split-lock mitigation[3].

Increase vm.max_map_count

If the value of the kernel parameter vm.max_map_count is too low, it can affect the stability and performance of some games[2]. As of writing the default value of vm.max_map_count in NixOS is 1048576[4]. According the the Arch Linux Wiki, SteamOS uses a default value of 2147483642[2], equivalent to maximum value of a 32-bit signed integer subtracted by 6. The value of vm.max_map_count can be altered in the system's configuration.nix file, as shown below.

boot.kernel.sysctl = {
  "vm.max_map_count" = 2147483642;
};

See also

  1. 1.0 1.1 "Linux Adding New Control Since Its Splitlock Detector Is Wrecking Some Steam Play Games", Michael Larabel, 2022-12-13, https://www.phoronix.com/news/Linux-Splitlock-Hurts-Gaming (Fetched 2026-09-12)
  2. 2.0 2.1 2.2 "Gaming", Arch Linux Wiki, https://wiki.archlinux.org/title/Gaming (Fetched 2026-09-12)
  3. https://github.com/FeralInteractive/gamemode/blob/a74b8106a2236d1f2696aa44c93bc4c8ef13b42e/example/gamemode.ini#L47 (Fetched 2026-09-12)
  4. https://github.com/NixOS/nixpkgs/blob/dbf04e179e41d471e6abb307d393329a27dfdfe7/nixos/modules/config/sysctl.nix#L118 (Fetched, 2026-09-12)