diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
commit | e6ed60548397627bf10f561f9438201dbba0a36e (patch) | |
tree | f9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/nixos/games | |
parent | 2024-04-18 (diff) |
2024-04-21
Diffstat (limited to 'modules/nixos/games')
-rw-r--r-- | modules/nixos/games/default.nix | 34 | ||||
-rw-r--r-- | modules/nixos/games/gamemode.nix | 14 | ||||
-rw-r--r-- | modules/nixos/games/lutris.nix | 31 | ||||
-rw-r--r-- | modules/nixos/games/mangohud.nix | 28 | ||||
-rw-r--r-- | modules/nixos/games/minecraft.nix | 86 | ||||
-rw-r--r-- | modules/nixos/games/steam-run.nix | 89 | ||||
-rw-r--r-- | modules/nixos/games/steam.nix | 33 |
7 files changed, 0 insertions, 315 deletions
diff --git a/modules/nixos/games/default.nix b/modules/nixos/games/default.nix deleted file mode 100644 index 585164e..0000000 --- a/modules/nixos/games/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ config, lib, ... }: -with lib; -let - cfg = config.nixfiles.modules.games; -in -{ - imports = [ - ./gamemode.nix - ./lutris.nix - ./mangohud.nix - ./minecraft.nix - ./steam-run.nix - ./steam.nix - ]; - - options.nixfiles.modules.games.enable32BitSupport = mkEnableOption "support for games"; - - config = mkIf cfg.enable32BitSupport { - services = { - jack.alsa.support32Bit = config.services.jack.alsa.enable; - - pipewire.alsa.support32Bit = config.services.pipewire.alsa.enable; - }; - - hardware = { - opengl = mkIf config.hardware.opengl.enable { - extraPackages32 = config.hardware.opengl.extraPackages; - driSupport32Bit = config.hardware.opengl.driSupport; - }; - - pulseaudio.support32Bit = config.hardware.pulseaudio.enable; - }; - }; -} diff --git a/modules/nixos/games/gamemode.nix b/modules/nixos/games/gamemode.nix deleted file mode 100644 index eb485f8..0000000 --- a/modules/nixos/games/gamemode.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, lib, ... }: -with lib; -let - cfg = config.nixfiles.modules.games.gamemode; -in -{ - options.nixfiles.modules.games.gamemode.enable = mkEnableOption "Feral GameMode"; - - config = mkIf cfg.enable { - hm.xdg.configFile."gamemode.ini".text = generators.toINI { } { general.softrealtime = "auto"; }; - - programs.gamemode.enable = true; - }; -} diff --git a/modules/nixos/games/lutris.nix b/modules/nixos/games/lutris.nix deleted file mode 100644 index 62fe521..0000000 --- a/modules/nixos/games/lutris.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.games.lutris; -in -{ - options.nixfiles.modules.games.lutris.enable = mkEnableOption "Lutris"; - - config = mkIf cfg.enable { - nixfiles.modules.games = { - gamemode.enable = true; - mangohud.enable = true; - steam-run.enable = true; - }; - - hm.home.packages = with pkgs; [ - (lutris.override { - extraPkgs = _: [ - vkBasalt - wine - winetricks - ]; - }) - ]; - }; -} diff --git a/modules/nixos/games/mangohud.nix b/modules/nixos/games/mangohud.nix deleted file mode 100644 index 955f50c..0000000 --- a/modules/nixos/games/mangohud.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, ... }: -with lib; -let - cfg = config.nixfiles.modules.games.mangohud; -in -{ - options.nixfiles.modules.games.mangohud.enable = mkEnableOption "MangoHud"; - - config = mkIf cfg.enable { - hm = { - stylix.targets.mangohud.enable = false; - - programs.mangohud = { - enable = true; - settings = { - fps = true; - frame_timing = true; - gpu_stats = true; - gpu_temp = true; - cpu_stats = true; - cpu_temp = true; - ram = true; - vram = true; - }; - }; - }; - }; -} diff --git a/modules/nixos/games/minecraft.nix b/modules/nixos/games/minecraft.nix deleted file mode 100644 index 6e163dc..0000000 --- a/modules/nixos/games/minecraft.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.games.minecraft; -in -{ - imports = [ inputs.minecraft.nixosModules.minecraft-servers ]; - - options.nixfiles.modules.games.minecraft = { - client.enable = mkEnableOption "Minecraft client"; - server = { - enable = mkEnableOption "Minecraft server"; - - port = mkOption { - description = "Server port."; - type = types.port; - default = 25565; - }; - - memory = mkOption { - description = "Amount of RAM to allocate."; - type = types.str; - default = "2G"; - }; - }; - }; - - config = mkMerge [ - (mkIf cfg.client.enable { hm.home.packages = [ pkgs.prismlauncher ]; }) - (mkIf cfg.server.enable { - nixfiles.modules.common.nix.allowedUnfreePackages = [ "minecraft-server" ]; - - ark.directories = [ config.services.minecraft-servers.dataDir ]; - - services.minecraft-servers = { - enable = true; - eula = true; - - openFirewall = true; - - servers.default = { - enable = true; - autoStart = true; - - package = pkgs.paperServers.paper-1_19_3; - - serverProperties = { - # motd = ""; - # white-list = true; - allow-flight = true; - difficulty = "hard"; - enable-command-block = true; - enforce-secure-profile = false; - enforce-whitelist = true; - gamemode = "survival"; - level-name = "default"; - max-players = 8; - online-mode = false; - previews-chat = false; - pvp = false; - server-port = cfg.server.port; - snooper-enabled = false; - }; - - jvmOpts = - (concatStringsSep " " [ - "-Xms${cfg.server.memory}" - "-Xmx${cfg.server.memory}" - "--add-modules=jdk.incubator.vector" # Required by some plugins. - ]) - + " "; - }; - }; - - nixpkgs.overlays = [ inputs.minecraft.overlay ]; - - my.extraGroups = [ config.services.minecraft-servers.group ]; - }) - ]; -} diff --git a/modules/nixos/games/steam-run.nix b/modules/nixos/games/steam-run.nix deleted file mode 100644 index cfee8ae..0000000 --- a/modules/nixos/games/steam-run.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.games.steam-run; -in -{ - options.nixfiles.modules.games.steam-run = { - enable = mkEnableOption "native Steam runtime"; - - quirks = { - blackIsleStudios = mkEnableOption "fixes for games from Black Isle Studios"; - cryptOfTheNecrodancer = mkEnableOption ''fixes for "Crypt of the NecroDancer" issues''; - mountAndBladeWarband = mkEnableOption ''fixes for "Mount & Blade: Warband" issues''; - }; - }; - - config = mkIf cfg.enable { - nixfiles.modules = { - common.nix.allowedUnfreePackages = [ - "steam" - "steam-run" - ]; - - games = { - enable32BitSupport = true; - gamemode.enable = true; - mangohud.enable = true; - }; - }; - - hm.home.packages = with pkgs; [ - (steam.override { - extraLibraries = - _: - with cfg.quirks; - optional blackIsleStudios openssl_1_0_0 - ++ optionals cryptOfTheNecrodancer [ - (import (builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/d1c3fea7ecbed758168787fe4e4a3157e52bc808.tar.gz"; - sha256 = "0ykm15a690v8lcqf2j899za3j6hak1rm3xixdxsx33nz7n3swsyy"; - }) { inherit (config.nixpkgs) config localSystem; }).flac - ] - ++ optionals mountAndBladeWarband [ - (glew.overrideAttrs ( - _: super: - let - opname = super.pname; - in - rec { - pname = "${opname}-steam-run-fix"; - inherit (super) version; - src = fetchurl { - url = "mirror://sourceforge/${opname}/${opname}-${version}.tgz"; - hash = "sha256-BN6R5+Z2MDm8EZQAlc2cf4gLq6ghlqd2X3J6wFqZPJU="; - }; - } - )) - (fmodex.overrideAttrs ( - _: super: - let - opname = super.pname; - in - rec { - pname = "${opname}-steam-run-fix"; - inherit (super) version; - installPhase = - let - libPath = makeLibraryPath [ - alsa-lib - libpulseaudio - stdenv.cc.cc - ]; - in - '' - install -Dm755 api/lib/libfmodex64-${version}.so $out/lib/libfmodex64.so - patchelf --set-rpath ${libPath} $out/lib/libfmodex64.so - ''; - } - )) - ]; - }).run - ]; - }; -} diff --git a/modules/nixos/games/steam.nix b/modules/nixos/games/steam.nix deleted file mode 100644 index 5883b0e..0000000 --- a/modules/nixos/games/steam.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.games.steam; -in -{ - options.nixfiles.modules.games.steam.enable = mkEnableOption "Steam runtime"; - - config = mkIf cfg.enable { - nixfiles.modules = { - common.nix.allowedUnfreePackages = [ - "steam" - "steam-original" - ]; - - games = { - enable32BitSupport = true; - gamemode.enable = true; - mangohud.enable = true; - }; - }; - - hm.home.packages = with pkgs; [ - (steam.override { extraEnv.MANGOHUD = 1; }) - protontricks - ]; - }; -} |