diff --git a/applications/games/minecraft.nix b/applications/games/minecraft.nix new file mode 100644 index 0000000..b294698 --- /dev/null +++ b/applications/games/minecraft.nix @@ -0,0 +1,56 @@ +{ + config, + pkgs, + lib, + inputs, + ... +}: let + # function to create the cname record for eachs erver + create_cname = configs: + lib.lists.forEach configs ( + c: { + record = "${c.address}.games"; + r_type = "CNAME"; + value = config.services.skynet.host.name; + } + ); + + # function to create the srv record + # this allows us to change the port without impacting (java) users + create_srv = configs: + lib.lists.forEach configs (c: { + record = "_minecraft._tcp.${c.address}.games.skynet.ie."; + r_type = "SRV"; + value = "0 10 ${c.port} ${config.services.skynet.host.name}.skynet.ie."; + }); + + servers = [ + { + address = "minecraft.compsoc"; + port = "25518"; + } + { + address = "minecraft-classic.compsoc"; + port = "25518"; + } + { + address = "minecraft-aged.compsoc"; + port = "25519"; + } + { + address = "minecraft.gsoc"; + port = "25521"; + } + { + address = "minecraft.phildeb"; + port = "25522"; + } + ]; +in { + imports = [ + ]; + + config = { + services.skynet.dns.records = (create_cname servers) ++ (create_srv servers); + }; +} diff --git a/machines/bumblebee.nix b/machines/bumblebee.nix index fcdf70f..e8e7a40 100644 --- a/machines/bumblebee.nix +++ b/machines/bumblebee.nix @@ -1,10 +1,10 @@ /* -Name: https://en.wikipedia.org/wiki/Optimus_Prime +Name: https://en.wikipedia.org/wiki/Bumblebee_(Transformers) Why: Created to sell toys so this vm is for games Type: VM Hardware: - -From: 2023 +From: 2024 Role: Game host Notes: */ @@ -27,6 +27,7 @@ Notes: in { imports = [ ../applications/pelican/pelican.nix + ../applications/games/minecraft.nix ]; deployment = {