feat: created nopde for pelican

This commit is contained in:
silver 2025-01-03 00:19:21 +00:00
parent aabb9d0708
commit 8334e2be70
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D
2 changed files with 59 additions and 2 deletions

View file

@ -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);
};
}

View file

@ -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 = {