Star Citizen: Difference between revisions

From NixOS Wiki
Initial Commit: added further links, example configuration & RAM + ZRAM & Swap section
 
m Added to categories: Applications & Gaming
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
* [https://github.com/fufexan/nix-gaming GitHub - fufexan/nix-gaming]
* [https://github.com/fufexan/nix-gaming GitHub - fufexan/nix-gaming]


= RAM, ZRAM & Swap =
== RAM, ZRAM & Swap ==
Bad news: Star Citizen requires a lot of RAM on Linux
Bad news: Star Citizen requires a lot of RAM on Linux


Line 54: Line 54:
</syntaxhighlight>
</syntaxhighlight>


 
[[Category:Applications]]
 
[[Category:Gaming]]
Note: the

Latest revision as of 18:41, 11 June 2024

Star Citizen is playable on NixOS, thanks to a few community projects. In case you have issues, over there is a good place to start

RAM, ZRAM & Swap

Bad news: Star Citizen requires a lot of RAM on Linux

Good news: ZRAM & Swap count! For the correct amounts, please see GitHub - starcitizen-lug/knowledge-base/wiki/Performance-Tuning#zram--swap

Example config

The below config is for a system with 16 GB of RAM. Adjust the ZRAM & Swap values as needed.

{ config, pkgs, ... }:

let
  nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
in
{
  # ...

  # See https://github.com/starcitizen-lug/knowledge-base/wiki/Manual-Installation#prerequisites
  boot.kernel.sysctl = {
    "vm.max_map_count" = 16777216;
    "fs.file-max" = 524288;
  };

  # See RAM, ZRAM & Swap
  swapDevices = [{
    device = "/var/lib/swapfile";
    size = 8 * 1024;  # 8 GB Swap
  }];
  zramSwap = {
    enable = true;
    memoryMax = 16 * 1024 * 1024 * 1024;  # 16 GB ZRAM
  };

  # The following line was used in my setup, but I'm unsure if it is still needed
  # hardware.pulseaudio.extraConfig = "load-module module-combine-sink";

  users.users.foo = {
    isNormalUser = true;
    description = "Foo";
    packages = with pkgs; [
      # tricks override to fix audio
      # see https://github.com/fufexan/nix-gaming/issues/165#issuecomment-2002038453
      (nix-gaming.packages.${pkgs.hostPlatform.system}.star-citizen.override {
        tricks = [ "arial" "vcrun2019" "win10" "sound=alsa" ];
      })
    ];
  };

  # ...
}