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);
|
||||
};
|
||||
}
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue