From fbae92812fb3edc54e4b3d59d0c8ceb18461c012 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Tue, 10 Dec 2024 00:39:48 -0800 Subject: [PATCH] snowhawk: star-citizen setup --- hosts/snowhawk/configuration.nix | 14 +++++++++----- modules/star-citizen.nix | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 modules/star-citizen.nix diff --git a/hosts/snowhawk/configuration.nix b/hosts/snowhawk/configuration.nix index ca98fe1..ef3c9f1 100644 --- a/hosts/snowhawk/configuration.nix +++ b/hosts/snowhawk/configuration.nix @@ -53,6 +53,7 @@ syncthing.enable = true; user.enable = true; wake-on-lan.enable = true; + star-citizen.enable = true; }; # Enable automatic login for the user. @@ -80,11 +81,6 @@ killall linux-manual - - (inputs.nix-gaming.packages.${pkgs.system}.star-citizen.override { - useUmu = true; - location = "/data/star-citizen"; - }) ]; fonts.packages = with pkgs; [ @@ -96,6 +92,14 @@ hardware.keyboard.uhk.enable = true; + swapDevices = [{ + device = "/swap"; + size = 16 * 1024; + }]; + + # Also recommended, either as an alternative or in addition + zramSwap.enable = true; + virtualisation = { libvirtd.enable = true; }; diff --git a/modules/star-citizen.nix b/modules/star-citizen.nix new file mode 100644 index 0000000..c1f4b62 --- /dev/null +++ b/modules/star-citizen.nix @@ -0,0 +1,24 @@ +{ lib, config, inputs, pkgs, ... }: + +let + cfg = config.snowhawk.star-citizen; +in +{ + options.snowhawk.star-citizen = { + enable = lib.mkEnableOption "star-citizen"; + }; + + config = lib.mkIf cfg.enable { + boot.kernel.sysctl = { + "vm.max_map_count" = 16777216; + "ds.file-max" = 524288; + }; + + environment.systemPackages = [ + (inputs.nix-gaming.packages.${pkgs.system}.star-citizen.override { + useUmu = true; + location = "/data/star-citizen"; + }) + ]; + }; +}