Allow specifying package

This commit is contained in:
niten 2023-07-10 11:54:01 -07:00
parent 00d3019934
commit c4ec7d8e04
1 changed files with 7 additions and 1 deletions

View File

@ -132,6 +132,12 @@ let
description = "Allow player-vs-player combat.";
default = true;
};
package = mkOption {
type = package;
description = "PaperMC package to launch.";
default = pkgs.papermc;
};
};
};
@ -254,7 +260,7 @@ in {
++ (optionals (worldOpts.allocated-memory >= 12) highMemFlags);
flagStr = concatStringsSep " " flags;
in pkgs.writeShellScript "mc-start-${sanitizedName}.sh"
"${pkgs.papermc}/bin/minecraft-server ${flagStr}";
"${cfg.package}/bin/minecraft-server ${flagStr}";
in nameValuePair serverName {
enable = worldOpts.enable;