nixos/openarena: cleanup

- Remove `with lib;`
- Add `package` config option
- Adjust paths accordingly in `ExecStart`
This commit is contained in:
Pol Dellaiera 2023-08-18 12:42:39 +02:00
parent 758b6fa94b
commit 849c75577d
No known key found for this signature in database
GPG key ID: D476DFE9C67467CA

View file

@ -1,14 +1,14 @@
{ config, lib, pkgs, ... }:
with lib;
let
inherit (lib) concatStringsSep mkEnableOption mkIf mkOption types;
cfg = config.services.openarena;
in
{
options = {
services.openarena = {
enable = mkEnableOption (lib.mdDoc "OpenArena");
package = lib.mkPackageOptionMD pkgs "openarena" { };
openPorts = mkOption {
type = types.bool;
@ -43,7 +43,7 @@ in
serviceConfig = {
DynamicUser = true;
StateDirectory = "openarena";
ExecStart = "${pkgs.openarena}/bin/oa_ded +set fs_basepath ${pkgs.openarena}/openarena-0.8.8 +set fs_homepath /var/lib/openarena ${concatStringsSep " " cfg.extraFlags}";
ExecStart = "${cfg.package}/bin/oa_ded +set fs_basepath ${cfg.package}/share/openarena +set fs_homepath /var/lib/openarena ${concatStringsSep " " cfg.extraFlags}";
Restart = "on-failure";
# Hardening