Skip to content

Commit

Permalink
✨ (config): Added the possibility to use a whole custom server config…
Browse files Browse the repository at this point in the history
…uration
  • Loading branch information
theobori committed Nov 7, 2024
1 parent d7e528c commit 71d7762
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/nixos/nix-teeworlds/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ let
'';
};

quickConfig = mkOption {
type = types.lines;
default = "";
description = ''
Custom configuration to use instead of the basics one.
'';
};

useQuickConfig = mkEnableOption "Enable quick configuration.";

register = mkOption {
type = types.bool;
default = false;
Expand Down Expand Up @@ -534,6 +544,9 @@ in
${lib.optionalString (server.extraConfig != null) server.extraConfig}
'';

serverConfig' =
if (server.useQuickConfig && server.quickConfig != "") then server.quickConfig else serverConfig;
in
{
description = "Teeworlds server ${name} managed by nix-teeworlds.";
Expand All @@ -551,7 +564,7 @@ in
name = "nix-teeworlds-${name}-start-pre";
text = ''
ln -sf ${server.dataDir} data
ln -sf ${serverConfig} autoexec.cfg
ln -sf ${serverConfig'} autoexec.cfg
'';
}
);
Expand Down

0 comments on commit 71d7762

Please sign in to comment.