diff --git a/flake.nix b/flake.nix index 767f8f1..23646d4 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,11 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + # Star citizen + nix-gaming = { + url = "github:fufexan/nix-gaming"; + }; nix-darwin = { url = "github:nix-darwin/nix-darwin/master"; diff --git a/hosts/common/modules.nix b/hosts/common/modules.nix index 3a09b2b..b2cbc0f 100644 --- a/hosts/common/modules.nix +++ b/hosts/common/modules.nix @@ -2,9 +2,10 @@ # Common nixos systems modules (not nix-darwin) imports = [ ../../modules/common/nix.nix + ../../modules/common/swap.nix ../../modules/nixos/locale.nix # For localisation options ../../modules/common/ssh.nix ../../modules/nixos/bootloader.nix ../../modules/common/environment.nix ]; -} \ No newline at end of file +} diff --git a/hosts/nixos/configuration.nix b/hosts/nixos/configuration.nix index f0ce5fc..b17b25f 100644 --- a/hosts/nixos/configuration.nix +++ b/hosts/nixos/configuration.nix @@ -91,18 +91,17 @@ # $ nix search wget environment = { systemPackages = with pkgs; [ - playerctl - - # Nvidia packages - nvtopPackages.nvidia - # Video accel - libva - libva-utils - # Cuda - cudatoolkit - - # Theme SDDM - sddm-astronaut + inputs.nix-gaming.packages.${pkgs.stdenv.hostPlatform.system}.star-citizen + playerctl + # Nvidia packages + nvtopPackages.nvidia + # Video accel + libva + libva-utils + # Cuda + cudatoolkit + # Theme SDDM + sddm-astronaut ]; # Hint Electron Apps to use Wayland sessionVariables.NIXOS_OZONE_WL = "1"; diff --git a/modules/common/nix.nix b/modules/common/nix.nix index b5db406..d7cfb78 100644 --- a/modules/common/nix.nix +++ b/modules/common/nix.nix @@ -18,16 +18,18 @@ # Package caches substituters = [ - "https://cache.nixos.org" - "https://nix-community.cachix.org" - "https://hyprland.cachix.org" + "https://cache.nixos.org" + "https://nix-community.cachix.org" + "https://hyprland.cachix.org" + "https://nix-gaming.cachix.org" ]; trusted-public-keys = [ - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + ]; }; }; diff --git a/modules/nixos/bootloader.nix b/modules/nixos/bootloader.nix index b498a97..d9f069d 100644 --- a/modules/nixos/bootloader.nix +++ b/modules/nixos/bootloader.nix @@ -1,13 +1,19 @@ { - boot = { - loader = { - systemd-boot = { - enable = true; - configurationLimit = 2; - }; - efi = { - canTouchEfiVariables = true; - }; + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 2; + }; + efi = { + canTouchEfiVariables = true; }; }; + kernel = { + sysctl = { + "vm.max_map_count" = 16777216; + "fs.file-max" = 524288; + }; + }; + }; } diff --git a/modules/nixos/swap.nix b/modules/nixos/swap.nix new file mode 100644 index 0000000..8b4d132 --- /dev/null +++ b/modules/nixos/swap.nix @@ -0,0 +1,10 @@ +{ + swapDevices = [{ + device = "/var/lib/swapfile"; + size = 8 * 1024; # 8 GB Swap + }]; + zramSwap = { + enable = true; + memoryMax = 16 * 1024 * 1024 * 1024; # 16 GB ZRAM + }; +}