Skip to content

Commit

Permalink
etna: add atm8 server
Browse files Browse the repository at this point in the history
  • Loading branch information
uku3lig committed Mar 6, 2024
1 parent ef63db9 commit 62ffb7b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
12 changes: 12 additions & 0 deletions secrets/etna/minecraftEnv.age
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNTEpCQjNnRXV2MWVzMzlN
UjBCT1N3YnZsRDZhbjlEUU80UVJ6cVpiSVh3CjhGck50cEIwSEVxdEpScGVyQXBn
aFJkN1UwZ3dtem1XeGJBc3FpRDViMkEKLT4gWDI1NTE5IEtRVnZ6K3JldkRjR1pt
TTFiNU9ENnVZS2ovR0ZYVmFkS3hWTkNOUUdmMXMKY2hid0JLRnR1VTRtL21leU8w
ODFkeC9FUTNBczBiV243NFFYQXArZmxpWQotPiBYMjU1MTkgM2FaYXlZelRQcWl2
dW9FZXFnNVJwUk9oVE5NQ0NvRld3ZUt4MlFLQlRtbwpDNWNBRkxrQVNJelBzTkRR
cHo4VlpyaUJwcWFsbTFwWGo1RE1kQWRWNHFJCi0tLSA4QTF4Ri9jN3dmcGE0MVlZ
d0t1Mm5nYjZEdHo3Nng3a2FyODZJNjZFdlBvCiXRrhrDLSuNnhVeto7Fwk5NFW69
dNLosE8qMZWZGlbC/mfViQWpHmazcdTdcGQRywNUseFpYJHbfQeYZzXK7Yc3FbJm
9LHet470aSKbzbZAnAhf4vdOb41wp8NgpIyBwiHizaNG79Dz
-----END AGE ENCRYPTED FILE-----
1 change: 1 addition & 0 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ in {
"etna/apiRsEnv.age".publicKeys = main ++ [etna];
"etna/ukubotRsEnv.age".publicKeys = main ++ [etna];
"etna/ngrokEnv.age".publicKeys = main ++ [etna];
"etna/minecraftEnv.age".publicKeys = main ++ [etna];
}
43 changes: 43 additions & 0 deletions systems/etna/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
apiRsEnv.file = "${path}/apiRsEnv.age";
ukubotRsEnv.file = "${path}/ukubotRsEnv.age";
ngrokEnv.file = "${path}/ngrokEnv.age";
minecraftEnv.file = "${path}/minecraftEnv.age";
};

boot.loader.systemd-boot.enable = true;

networking.firewall.allowedTCPPorts = [4040];

services = {
api-rs = {
enable = true;
Expand Down Expand Up @@ -54,6 +57,25 @@
};
};

frp = {
enable = true;
role = "client";
settings = {
serverAddr = "45.10.154.114";
serverPort = 7000;

proxies = [
{
name = "minecraft";
type = "tcp";
localIp = "127.0.0.1";
localPort = 25565;
remotePort = 6000;
}
];
};
};

cloudflared = {
enable = true;
tunnels."57f51ad7-25a0-45f3-b113-0b6ae0b2c3e5" = {
Expand Down Expand Up @@ -98,4 +120,25 @@
};
};
};

virtualisation.oci-containers.containers = {
"minecraft" = {
image = "itzg/minecraft-server";
ports = ["25565:25565"];
volumes = [
"/data/minecraft:/data"
"/data/downloads:/downloads"
];
environmentFiles = [
config.age.secrets.minecraftEnv.path
];
environment = {
EULA = "true";
MEMORY = "12G";
TYPE = "AUTO_CURSEFORGE";
CF_SLUG = "all-the-mods-8";
CF_FILE_ID = "4962718";
};
};
};
}

0 comments on commit 62ffb7b

Please sign in to comment.