diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-08-19 06:48:13 +0200 |
---|---|---|
committer | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2023-08-19 07:07:08 +0200 |
commit | 5fdff213c9ac02b2ad79f6c42de7deb77a6cd8ac (patch) | |
tree | a272f30955516f213a0a43d1911923823def6381 /nixos/modules | |
parent | dbcc734bbd3bd1ef1f3cee11aa72452d498db745 (diff) |
nixos/quake3-server: add `package` config option
- Remove top-level `with lib;`
Diffstat (limited to 'nixos/modules')
-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 2d2148237da16..e51830c12e788 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 ]; } |