diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-08-19 12:31:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-19 12:31:33 +0200 |
commit | cac8909c856c5c4793cf90e0a975eb38ce791fc5 (patch) | |
tree | 8031d91a3481692ed5048ada53dad6f264adcdb6 /nixos/modules/services/games | |
parent | 24c5103ba321773da88365f3dd2b3fc700081c63 (diff) | |
parent | 5fdff213c9ac02b2ad79f6c42de7deb77a6cd8ac (diff) |
Merge pull request #250100 from NixOS/ioquake3/update
ioquake3: fix missing `.so` files at startup and clean-up
Diffstat (limited to 'nixos/modules/services/games')
-rw-r--r-- | nixos/modules/services/games/quake3-server.nix | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/services/games/quake3-server.nix b/nixos/modules/services/games/quake3-server.nix index 2d2148237da1..e51830c12e78 100644 --- a/nixos/modules/services/games/quake3-server.nix +++ b/nixos/modules/services/games/quake3-server.nix @@ -1,13 +1,15 @@ { config, pkgs, lib, ... }: -with lib; let + inherit (lib) literalMD mkEnableOption mkIf mkOption types; cfg = config.services.quake3-server; + configFile = pkgs.writeText "q3ds-extra.cfg" '' set net_port ${builtins.toString cfg.port} ${cfg.extraConfig} ''; + defaultBaseq3 = pkgs.requireFile rec { name = "baseq3"; hashMode = "recursive"; @@ -25,6 +27,7 @@ let $services.quake3-server.baseq3/.q3a/ ''; }; + home = pkgs.runCommand "quake3-home" {} '' mkdir -p $out/.q3a/baseq3 @@ -38,6 +41,7 @@ in { options = { services.quake3-server = { enable = mkEnableOption (lib.mdDoc "Quake 3 dedicated server"); + package = lib.mkPackageOptionMD pkgs "ioquake3" { }; port = mkOption { type = types.port; @@ -103,10 +107,10 @@ in { ReadOnlyPaths = if baseq3InStore then home else cfg.baseq3; ExecStartPre = optionalString (!baseq3InStore) "+${pkgs.coreutils}/bin/cp ${configFile} ${cfg.baseq3}/.q3a/baseq3/nix.cfg"; - ExecStart = "${pkgs.ioquake3}/ioq3ded.x86_64 +exec nix.cfg"; + ExecStart = "${cfg.package}/bin/ioq3ded +exec nix.cfg"; }; }; }; - meta.maintainers = with maintainers; [ f4814n ]; + meta.maintainers = with lib.maintainers; [ f4814n ]; } |