All Projects → fufexan → nix-gaming

fufexan / nix-gaming

Licence: MIT license
Gaming on Nix

Programming Languages

Nix
1067 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to nix-gaming

dotfiles
NixOS system config & Home-Manager user config
Stars: ✭ 43 (-69.72%)
Mutual labels:  nix, nixos, pipewire
Vulnix
Vulnerability (CVE) scanner for Nix/NixOS.
Stars: ✭ 161 (+13.38%)
Mutual labels:  nix, nixos
fromElisp
An Emacs Lisp reader in Nix.
Stars: ✭ 26 (-81.69%)
Mutual labels:  nix, nixos
Nixos Mailserver
A complete and Simple Nixos Mailserver
Stars: ✭ 172 (+21.13%)
Mutual labels:  nix, nixos
gradle2nix
Generate Nix expressions which build Gradle-based projects.
Stars: ✭ 71 (-50%)
Mutual labels:  nix, nixos
Nix Bitcoin
A collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
Stars: ✭ 154 (+8.45%)
Mutual labels:  nix, nixos
Nix 1p
A (more or less) one page introduction to Nix, the language.
Stars: ✭ 219 (+54.23%)
Mutual labels:  nix, nixos
Shabka
Shabka. Declaritive description of my network, workstations and servers.
Stars: ✭ 138 (-2.82%)
Mutual labels:  nix, nixos
Nixbox
NixOS Vagrant boxes [[email protected]]
Stars: ✭ 189 (+33.1%)
Mutual labels:  nix, nixos
rc
Structured system configuration (I moved from NixOS to GuixSD)
Stars: ✭ 97 (-31.69%)
Mutual labels:  nix, nixos
dotfiles
My NixOS configuration featuring awesome and neovim
Stars: ✭ 40 (-71.83%)
Mutual labels:  nix, nixos
Mach Nix
Create highly reproducible python environments
Stars: ✭ 231 (+62.68%)
Mutual labels:  nix, nixos
Dotfiles
My dotfiles
Stars: ✭ 150 (+5.63%)
Mutual labels:  nix, nixos
Home Manager
Manage a user environment using Nix [maintainer=@rycee]
Stars: ✭ 2,447 (+1623.24%)
Mutual labels:  nix, nixos
Appvm
Nix-based app VMs
Stars: ✭ 146 (+2.82%)
Mutual labels:  nix, nixos
Deploy Rs
A simple multi-profile Nix-flake deploy tool.
Stars: ✭ 164 (+15.49%)
Mutual labels:  nix, nixos
Arion
Run docker-compose with help from Nix/NixOS
Stars: ✭ 202 (+42.25%)
Mutual labels:  nix, nixos
Nixos Manager
Manage your NixOS packages and configuration via a simple, intuitive UI
Stars: ✭ 128 (-9.86%)
Mutual labels:  nix, nixos
Nixos Weekly
NixOS Weekly Newsletter
Stars: ✭ 137 (-3.52%)
Mutual labels:  nix, nixos
Nixpkgs Wayland
Automated, pre-built packages for Wayland (sway/wlroots) tools for NixOS.
Stars: ✭ 178 (+25.35%)
Mutual labels:  nix, nixos

nix-gaming

Gaming related stuff for Nix and NixOS.

See an overview of the flake outputs by running nix flake show github:fufexan/nix-gaming.

🗃️ What's in here?

Package Description
faf-client Forged Alliance Forever client (using the official binary build)
faf-client-unstable Same as above, but use unstable version if available
osu-lazer-bin osu! lazer, extracted from the official AppImage
osu-stable osu! stable version
rocket-league Rocket League from Epic Games
technic-launcher Technic Launcher
wine-discord-ipc-bridge Wine-Discord RPC Bridge
wine-ge Wine version of Proton-GE
wine-osu Wine optimized for low latency
wine-tkg Wine optimized for games
winestreamproxy Wine-Discord RPC (broken)
  • To run FAF, first run Supreme Commander: Forged Alliance via Steam normally at least once. After you make sure it works, run faf-client-setup to set up the path to game data, settings and Proton wrapper correctly.

  • legendaryBuilder is a function that installs games with legendary-gl. You are expected to log in before using it, with legendary auth. The function takes an attrset containing at least the attrset games which includes the games you want installed. Optionally, you can set an opts attrset that will set the options you set inside for all games listed. You can find a usage example in example.nix.

  • osu-lazer-bin is an osu!lazer build that is extracted from official binary releases in order to preserve multiplayer functions.

  • osu-stable provides a script that installs/runs osu! automatically, in addition to a desktop entry. Installation will take a bit of time. It will download and install about 400MB of files. In any case, do not stop the command! If anything goes wrong and for some reason osu! won't start, delete the ~/.osu directory and re-run osu-stable.

  • technic-launcher will guide you through the install process, just like it normally would. Some modpacks will complain about libraries, and that is expected. In such cases you may want to enable the withSteamRun = true; override flag. This will run technic-launcher with steam-run and prevent those errors.

  • wine-discord-ipc-bridge provides bridging between games under Wine and Discord running on Linux.

  • wine-ge is the wine equivalent of the famous Proton-GE. It is based on wine-tkg, and is expected to work better than it.

  • wine-osu is wine-staging, with patches applied to make it low-latency. The patches can be found here.

  • wine-tkg is a special wine version, tailored for the best gaming experience. It consists of a wine tree generated with the tkg patches.

  • winestreamproxy provides bridging between games under Wine and Discord running on Linux. (currently broken, help with building would be appreciated)

Install & Run

It's recommended to set up Cachix so you don't have to build packages.

# configuration.nix
{
  nix.settings = {
    substituters = ["https://nix-gaming.cachix.org"];
    trusted-public-keys = ["nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="];
  };
}

Now, rebuild your configuration and continue reading for install instructions.

If you're not using flakes, go here.

❄️ Flakes

Add these packages to your home.packages or environment.systemPackages by adding nix-gaming as an input:

# flake.nix
{
  inputs.nix-gaming.url = github:fufexan/nix-gaming;
}

Also, add inputs or nix-gaming to specialArgs when building your system config, or to extraSpecialArgs when building your Home Manager configuration.

Then, add the package(s):

{pkgs, config, inputs, ...}: {
  environment.systemPackages = [ # or home.packages
    inputs.nix-gaming.packages.${pkgs.hostPlatform.system}.<package> # installs a package
  ];
}

If you want to install packages to your profile instead, do it like this

  nix profile install github:fufexan/nix-gaming#<package>

Everything is available as an overlay if you prefer that, though your results may greatly differ from the packages.

Nix Stable

To install packages to environment.systemPackages, add this in configuration.nix:

{pkgs, ...}: let
  nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
in {
  # import the low latency module
  imports = [
    ...
    "${nix-gaming}/modules/pipewireLowLatency.nix"
  ];
  
  # install packages
  environment.systemPackages = [ # or home.packages
    nix-gaming.packages.${pkgs.hostPlatform.system}.<package>
  ];
  
  # enable module (see below)
  services.pipewire = ...;
}

PipeWire low latency

PipeWire is a new audio backend that replaces ALSA, PulseAudio and JACK. It is as low latency as JACK and as easy to use as Pulse.

This module extends the PipeWire module from Nixpkgs and makes it easy to enable the low latency settings in a few lines.

Import the module in your configuration and enable it along with PipeWire:

{
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;

    lowLatency = {
      # enable this module      
      enable = true;
      # defaults (no need to be set unless modified)
      quantum = 64;
      rate = 48000;
    };
  };
  
  # make pipewire realtime-capable
  security.rtkit.enable = true;
}

If you get no sound, you may want to increase quantum, usually to an even number or the prefix of the rate (48/48000 is exactly 1ms).

Game overrides

The game derivations were written with versatility in mind. There are arguments that can be modified in order to get the desired result.

{
  wine      ? wine-tkg,         # controls the wine package used to run wine games
  wineFlags ? null,             # which flags to run wine with
  pname     ? "game-name",      # name of the script and package
  location  ? "$HOME/${pname}", # where to install the game/wine prefix
  tricks    ? null,             # which wine tricks to install

  preCommands  ? "",            # run commands before the game is started
  postCommands ? "",            # run commands after the game is closed
}:

osu-stable wine-discord-ipc-bridge wine overriding

Sometimes you want to override wine for various reasons. Here's how to do it:

{
  environment.systemPackages = let
    nix-gaming = inputs.nix-gaming.packages.${pkgs.hostPlatform.system};
  in [ # or home.packages
    nix-gaming.osu-stable.override rec {
      wine = <your-wine>;
      wine-discord-ipc-bridge = nix-gaming.wine-discord-ipc-bridge.override {inherit wine;}; # or override this one as well
    };
  ];
}

Tips

In order to get the most performance out of your machine, you could use the following tweaks:

  • custom/gaming kernel: linux_xanmod is the recommended one for games, since it provides many patches that aid wine and other games. It also provides a better desktop experience due to its preemptive build and tickless scheduler.
  • gamemode: lets you achieve lower nice values and higher realtime privileges at game start. It can either detect games or be told to start with gamemode-run.

👥 Credits & Resources

Thank you: boppyt - gonX - InfinityGhost - LavaDesu - openglfreak - yusdacra and to all the contributors and users of this repo!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].