nixos/kelder: Add Minecraft server

This commit is contained in:
Jack O'Sullivan 2023-05-28 01:21:41 +01:00
parent dd31b95945
commit 3a5679a76d
2 changed files with 27 additions and 0 deletions

View File

@ -121,6 +121,7 @@ in
username = "token"; username = "token";
passwordFile = config.age.secrets."kelder/ddclient-cloudflare.key".path; passwordFile = config.age.secrets."kelder/ddclient-cloudflare.key".path;
}; };
samba = { samba = {
enable = true; enable = true;
enableNmbd = true; enableNmbd = true;
@ -135,6 +136,20 @@ in
}; };
}; };
samba-wsdd.enable = true; samba-wsdd.enable = true;
minecraft-server = {
enable = true;
package = pkgs.minecraftServers.vanilla-1-19;
declarative = true;
eula = true;
whitelist = {
devplayer0 = "6d7d971b-ce10-435b-85c5-c99c0d8d288c";
};
serverProperties = {
motd = "Simpcraft";
white-list = true;
};
};
}; };
networking = { networking = {
@ -245,6 +260,8 @@ in
firewall = { firewall = {
trustedInterfaces = [ "ctrs" ]; trustedInterfaces = [ "ctrs" ];
tcp.allowed = [ 25565 ];
udp.allowed = [ 25565 ];
nat = { nat = {
enable = true; enable = true;
externalInterface = "{ et1g0, estuary }"; externalInterface = "{ et1g0, estuary }";

View File

@ -408,6 +408,16 @@ in
} }
]; ];
}) })
(mkIf config.services.minecraft-server.enable {
my.tmproot.persistence.config.directories = [
{
directory = config.services.minecraft-server.dataDir;
mode = "0750";
user = "minecraft";
group = "minecraft";
}
];
})
(mkIf config.services.samba.enable { (mkIf config.services.samba.enable {
my.tmproot.persistence.config.directories = [ my.tmproot.persistence.config.directories = [
"/var/lib/samba" "/var/lib/samba"