nixos-config/modules/minecraft/multiverse.nix

67 lines
1.5 KiB
Nix
Raw Normal View History

2022-06-12 15:39:15 +00:00
{
config,
lib,
options,
pkgs,
...
}:
with lib; let
multiverse = pkgs.callPackage ../../packages/minecraft/multiverse.nix {};
2022-02-24 09:00:53 +00:00
cfg = config.services.minecraft.multiverse;
opt = options.services.minecraft.multiverse;
2022-06-12 15:39:15 +00:00
in {
2022-02-24 09:00:53 +00:00
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 [
2022-06-12 15:39:15 +00:00
[
{
package = multiverse.core;
2022-02-24 09:16:48 +00:00
startScript = pkgs.writeScript "dummy" "";
2022-06-12 15:39:15 +00:00
}
]
(mkIf cfg.netherportals
[
{
package = multiverse.nether-portals;
startScript = pkgs.writeScript "dummy" "";
}
])
2022-02-24 09:16:48 +00:00
(mkIf cfg.signportals
2022-06-12 15:39:15 +00:00
[
{
package = multiverse.sign-portals;
startScript = pkgs.writeScript "dummy" "";
}
])
2022-02-24 09:16:48 +00:00
(mkIf cfg.inventories
2022-06-12 15:39:15 +00:00
[
{
package = multiverse.inventories;
startScript = pkgs.writeScript "dummy" "";
}
])
2022-02-24 09:00:53 +00:00
];
};
}