2022-02-24 09:00:53 +00:00
|
|
|
{ config, lib, options, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
multiverse = pkgs.callPackage ../../packages/minecraft/multiverse.nix { };
|
|
|
|
cfg = config.services.minecraft.multiverse;
|
|
|
|
opt = options.services.minecraft.multiverse;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.services.minecraft.multiverse = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Enable Multiverse";
|
|
|
|
type = types.bool;
|
|
|
|
};
|
2022-02-24 09:16:48 +00:00
|
|
|
netherportals = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Enable Nether portals";
|
|
|
|
type = types.bool;
|
|
|
|
};
|
|
|
|
signportals = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Enable sign portals";
|
|
|
|
type = types.bool;
|
|
|
|
};
|
|
|
|
inventories = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Enable inventories";
|
|
|
|
type = types.bool;
|
|
|
|
};
|
2022-02-24 09:00:53 +00:00
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.minecraft.plugins = mkMerge [
|
|
|
|
[{
|
|
|
|
package = multiverse.core;
|
|
|
|
startScript = pkgs.writeScript "dummy" "";
|
|
|
|
}]
|
2022-02-24 09:16:48 +00:00
|
|
|
(mkIf cfg.netherportals
|
|
|
|
[{
|
|
|
|
package = multiverse.nether-portals;
|
|
|
|
startScript = pkgs.writeScript "dummy" "";
|
|
|
|
}])
|
|
|
|
(mkIf cfg.signportals
|
|
|
|
[{
|
|
|
|
package = multiverse.sign-portals;
|
|
|
|
startScript = pkgs.writeScript "dummy" "";
|
|
|
|
}])
|
|
|
|
(mkIf cfg.inventories
|
|
|
|
[{
|
|
|
|
package = multiverse.inventories;
|
|
|
|
startScript = pkgs.writeScript "dummy" "";
|
|
|
|
}])
|
2022-02-24 09:00:53 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|