{"id":13611090,"url":"https://github.com/fufexan/nix-gaming","last_synced_at":"2025-05-15T06:03:33.456Z","repository":{"id":37241451,"uuid":"394001898","full_name":"fufexan/nix-gaming","owner":"fufexan","description":"Gaming on Nix","archived":false,"fork":false,"pushed_at":"2025-05-15T01:52:55.000Z","size":909,"stargazers_count":697,"open_issues_count":22,"forks_count":60,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-15T06:03:03.034Z","etag":null,"topics":["epic","gaming","legendary","nix","nixos","osu","pipewire","tkg","wine","wine-ge"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fufexan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-08T15:42:58.000Z","updated_at":"2025-05-15T01:52:58.000Z","dependencies_parsed_at":"2024-02-29T02:26:48.263Z","dependency_job_id":"5b342632-1e07-48f3-975c-3837c49ae274","html_url":"https://github.com/fufexan/nix-gaming","commit_stats":{"total_commits":567,"total_committers":33,"mean_commits":"17.181818181818183","dds":0.5696649029982364,"last_synced_commit":"3e51c9884bca93625ff1deca440e30c8d2f2e522"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fufexan%2Fnix-gaming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fufexan%2Fnix-gaming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fufexan%2Fnix-gaming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fufexan%2Fnix-gaming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fufexan","download_url":"https://codeload.github.com/fufexan/nix-gaming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283336,"owners_count":22045140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["epic","gaming","legendary","nix","nixos","osu","pipewire","tkg","wine","wine-ge"],"created_at":"2024-08-01T19:01:51.705Z","updated_at":"2025-05-15T06:03:33.433Z","avatar_url":"https://github.com/fufexan.png","language":"Nix","funding_links":[],"categories":["Nix","Flake Modules","gaming"],"sub_categories":["Community Modules"],"readme":"\u003ch1 align=\"center\"\u003e🎮 nix-gaming\u003c/h1\u003e\n\nGaming related stuff for Nix and NixOS.\n\nSee an overview of the flake outputs by running\n`nix flake show github:fufexan/nix-gaming`.\n\n## 🗃️ What's in here?\n\n| Package                                                     | Description                                                                                            |\n| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| [`faf-client`](./pkgs/faf-client)                           | Forged Alliance Forever client (multiple packages)                                                     |\n| [`osu-lazer-bin`](./pkgs/osu-lazer-bin)                     | osu! lazer, extracted from the official AppImage                                                       |\n| [`osu-stable`](./pkgs/osu-stable)                           | osu! stable version                                                                                    |\n| `rocket-league`                                             | Rocket League from Epic Games                                                                          |\n| [`star-citizen`](./pkgs/star-citizen)                       | Star Citizen                                                                                           |\n| [`technic-launcher`](./pkgs/technic-launcher)               | Technic Launcher                                                                                       |\n| [`wine-discord-ipc-bridge`](./pkgs/wine-discord-ipc-bridge) | Wine-Discord RPC Bridge                                                                                |\n| [`wine`](./pkgs/wine)                                       | Multiple Wine packages                                                                                 |\n| [`winestreamproxy`](./pkgs/winestreamproxy)                 | Wine-Discord RPC (broken)                                                                              |\n| [`mo2installer`](./pkgs/mo2installer)                       | RockerBacon's Mod Organizer 2 installer script                                                         |\n| [`northstar-proton`](./pkgs/titanfall/northstar-proton.nix) | Proton build based on TKG's proton-tkg build system to run the Northstar client on Linux and SteamDeck |\n| [`viper`](./pkgs/titanfall/viper.nix)                       | Launcher+Updater for Titanfall2 Northstar Client                                                       |\n\n- `legendaryBuilder` is a function that installs games with `legendary-gl`. You\n  are expected to log in before using it, with `legendary auth`. The function\n  takes an attrset containing at least the attrset `games` which includes the\n  games you want installed. Optionally, you can set an `opts` attrset that will\n  set the options you set inside for all games listed. You can find a usage\n  example in [example.nix](./example.nix).\n\n## Install \u0026 Run\n\nIt's recommended to set up [Cachix](https://app.cachix.org/cache/nix-gaming) so\nyou don't have to build packages (most useful for wine).\n\n```nix\n# configuration.nix\n{\n  nix.settings = {\n    substituters = [\"https://nix-gaming.cachix.org\"];\n    trusted-public-keys = [\"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=\"];\n  };\n}\n```\n\nNow, rebuild your configuration and continue reading for install instructions.\n\n#### If you're not using flakes, [go here](#nix-stable).\n\n### ❄️ Flakes\n\nAdd these packages to your `home.packages` or `environment.systemPackages` by\nadding `nix-gaming` as an input:\n\n```nix\n# flake.nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    home-manager.url = \"github:nix-community/home-manager\";\n\n    nix-gaming.url = \"github:fufexan/nix-gaming\";\n  };\n\n  outputs = {self, nixpkgs, ...}@inputs: {\n    # set up for NixOS\n    nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {\n      specialArgs = {inherit inputs;};\n      modules = [\n        ./configuration.nix\n        # ...\n      ];\n    };\n\n    # or for Home Manager\n    homeConfigurations.HOSTNAME = inputs.home-manager.lib.homeManagerConfiguration {\n      pkgs = import nixpkgs {\n        system = \"x86_64-linux\";\n        config.allowUnfree = true;\n      };\n\n      extraSpecialArgs = {inherit inputs;};\n\n      modules = [\n        ./home.nix\n        # ...\n      ];\n    }\n  };\n}\n```\n\nThen, add the package(s):\n\n```nix\n{pkgs, inputs, ...}: {\n  environment.systemPackages = [ # or home.packages\n    inputs.nix-gaming.packages.${pkgs.system}.\u003cpackage\u003e # installs a package\n  ];\n}\n```\n\nIf you want to install packages to your profile instead, do it like this\n\n```console\nnix profile install github:fufexan/nix-gaming#\u003cpackage\u003e\n```\n\nEverything is available as an overlay if you prefer that, though your results\nmay greatly differ from the packages.\n\n### Nix Stable\n\nTo install packages to `environment.systemPackages`, add this in\n`configuration.nix`:\n\n```nix\n{pkgs, ...}: let\n  nix-gaming = import (builtins.fetchTarball \"https://github.com/fufexan/nix-gaming/archive/master.tar.gz\");\nin {\n  # install packages\n  environment.systemPackages = [ # or home.packages\n    nix-gaming.packages.${pkgs.hostPlatform.system}.\u003cpackage\u003e\n  ];\n}\n```\n\n## Modules\n\nHere are some NixOS modules for setting gaming related options.\n\n### Installation\n\n#### Flakes\n\nAssuming you've followed the [Install/Flakes](#️-flakes) instructions, all you\nneed to do is add the module to your configuration like this:\n\n```nix\n{inputs, ...}: {\n  imports = [\n    inputs.nix-gaming.nixosModules.\u003cmodule name\u003e\n  ];\n}\n```\n\nNow you can skip to the Usage section of a specific module.\n\n#### Stable\n\nAssuming you've followed the [Install/Nix Stable](#nix-stable) instructions, all\nyou need to do is add the module to your configuration like this:\n\n```nix\n{pkgs, ...}: let\n  nix-gaming = /* ... */;\nin {\n  imports = [\n    nix-gaming.nixosModules.\u003cmodule name\u003e\n  ];\n}\n```\n\n### PipeWire low latency\n\n[PipeWire](https://wiki.nixos.org/wiki/PipeWire) is a new audio backend that\nreplaces ALSA, PulseAudio and JACK. It is as low latency as JACK and as easy to\nuse as Pulse.\n\nThis module extends the PipeWire module from Nixpkgs and makes it easy to enable\nthe low latency settings in a few lines.\n\n#### Usage\n\nAfter importing the module in your configuration like described above, enable it\nalong with PipeWire:\n\n```nix\n{\n  services.pipewire = {\n    enable = true;\n    alsa.enable = true;\n    alsa.support32Bit = true;\n    pulse.enable = true;\n\n    lowLatency = {\n      # enable this module\n      enable = true;\n      # defaults (no need to be set unless modified)\n      quantum = 64;\n      rate = 48000;\n    };\n  };\n\n  # make pipewire realtime-capable\n  security.rtkit.enable = true;\n}\n```\n\nIf you get no sound, you may want to increase `quantum`.\n\nYou can calculate the theoretical latency by dividing `quantum` by `rate`\n(`48/48000` is exactly 1ms).\n\n### Platform optimizations\n\n[SteamOS](https://store.steampowered.com/steamos) on the steam deck has set some\nspecific sysctl settings, so that some games can be run at all, or perform\nbetter under certain circumstances.\n\nThis module extends the Steam module from Nixpkgs but can be enabled as a\nstandalone option.\n\n#### Usage\n\nAfter importing the module in your configuration like described above, enable it\nlike this:\n\n```nix\n{\n  programs.steam.platformOptimizations.enable = true;\n}\n```\n\n## ⚙ Game overrides\n\nWine-based game derivations were written with versatility in mind.\n\nThese arguments can be modified in order to get the desired results.\n\n```nix\n{\n  wine      ? wine-ge,          # controls the wine package used to run wine games\n  wineFlags ? \"\",               # which flags to run wine with (literal)\n  pname     ? \"game-name\",      # name of the script and package\n  location  ? \"$HOME/${pname}\", # where to install the game/wine prefix\n  tricks    ? [],               # which wine tricks to install\n\n  preCommands  ? \"\",            # run commands before the game is started\n  postCommands ? \"\",            # run commands after the game is closed\n}:\n```\n\n### `osu-stable` `wine-discord-ipc-bridge` wine overriding\n\nSometimes you want to override `wine` for various reasons. Here's how to do it:\n\n```nix\n{\n  environment.systemPackages = let\n    gamePkgs = inputs.nix-gaming.packages.${pkgs.hostPlatform.system};\n  in [ # or home.packages\n    gamePkgs.osu-stable.override rec {\n      wine = \u003cyour-wine\u003e;\n      wine-discord-ipc-bridge = gamePkgs.wine-discord-ipc-bridge.override {inherit wine;}; # or override this one as well\n    };\n  ];\n}\n```\n\n## 📝 Tips\n\nIn order to get the most performance out of your machine, you could use the\nfollowing tweaks:\n\n- custom/gaming kernel: `linux_xanmod` is the recommended one for games, since\n  it provides many patches that aid wine and other games. It also provides a\n  better desktop experience due to its preemptive build and tickless scheduler.\n- [gamemode](https://github.com/FeralInteractive/gamemode): lets you achieve\n  lower nice values and higher realtime privileges at game start. It can either\n  detect games or be started with `gamemode-run`.\n\n## 👥 Credits \u0026 Resources\n\nThank you: boppyt - gonX - InfinityGhost - LavaDesu - openglfreak - yusdacra and\nto all the contributors and users of this repo!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffufexan%2Fnix-gaming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffufexan%2Fnix-gaming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffufexan%2Fnix-gaming/lists"}