Starsector: Difference between revisions

From NixOS Wiki
Makuru (talk | contribs)
Made it more clear, how to use the workaround.
Klinger (talk | contribs)
m Category:Applications added, Guide removed
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
   environment.systemPackages = [
   environment.systemPackages = [
     # overrides the NixOS package, starsector, see: https://wiki.nixos.org/wiki/Starsector
     # overrides the NixOS package, starsector, see: https://wiki.nixos.org/wiki/Starsector
     (starsector.overrideAttrs ({ ... }: {
     (pkgs.starsector.overrideAttrs ({ ... }: {
       postInstall = ''
       postInstall = ''
         cp ${dotfiles/starsector/settings.json} $out/share/starsector/data/config/settings.json
         cp ${dotfiles/starsector/settings.json} $out/share/starsector/data/config/settings.json
Line 23: Line 23:
   ];
   ];
</syntaxhighlight>This commands takes the <code><code>settings.json</code></code> and changes the commandline parameters:<code>Xms</code> <code>Xmx</code> to take <code>8192m</code> or <code>8GiB</code> of RAM.
</syntaxhighlight>This commands takes the <code><code>settings.json</code></code> and changes the commandline parameters:<code>Xms</code> <code>Xmx</code> to take <code>8192m</code> or <code>8GiB</code> of RAM.
[[Category:Guide]]
[[Category:Applications]]
[[Category:Gaming]]
[[Category:Gaming]]

Latest revision as of 17:41, 9 December 2024

Starsector (formerly “Starfarer”) is an open-world single-player space-combat, roleplaying, exploration, and economic game. You take the role of a space captain seeking fortune and glory however you choose.

Installation

Install starsector by adding following into your NixOS config:

  environment.systemPackages = [
    pkgs.starsector
  ];

Tips and tricks

To change the amount of memory, the starsector game can use, add the following command to NixOS.

  environment.systemPackages = [
    # overrides the NixOS package, starsector, see: https://wiki.nixos.org/wiki/Starsector
    (pkgs.starsector.overrideAttrs ({ ... }: {
      postInstall = ''
        cp ${dotfiles/starsector/settings.json} $out/share/starsector/data/config/settings.json

        substituteInPlace $out/share/starsector/.starsector.sh-wrapped \
          --replace-fail "Xms1536m" "Xms8192m" \
          --replace-fail "Xmx1536m" "Xmx8192m"
      '';
    }))
  ];

This commands takes the settings.json and changes the commandline parameters:Xms Xmx to take 8192m or 8GiB of RAM.