feat: created nopde for pelican
This commit is contained in:
parent
aabb9d0708
commit
8334e2be70
2 changed files with 59 additions and 2 deletions
56
applications/games/minecraft.nix
Normal file
56
applications/games/minecraft.nix
Normal 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);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue