diff --git a/configurations/camelot/default.nix b/configurations/camelot/default.nix index d299993..27ef456 100644 --- a/configurations/camelot/default.nix +++ b/configurations/camelot/default.nix @@ -55,6 +55,7 @@ my.server.mollysocket.enable = true; my.server.blog.enable = true; + my.server.papermc.enable = true; my.users = { dala = { diff --git a/modules/server/default.nix b/modules/server/default.nix index e27f02c..664bfe4 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -5,5 +5,6 @@ ./nginx.nix ./mollysocket.nix ./blog.nix + ./minecraft.nix ]; } diff --git a/modules/server/minecraft.nix b/modules/server/minecraft.nix new file mode 100644 index 0000000..6df2f86 --- /dev/null +++ b/modules/server/minecraft.nix @@ -0,0 +1,22 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; +{ + options.my.server.papermc.enable = mkOption { + type = types.bool; + default = false; + }; + + config = mkIf config.my.server.papermc.enable { + services.minecraft-server = { + enable = true; + package = pkgs.papermc; + dataDir = "/srv/minecraft"; + openFirewall = true; + }; + }; +}