diff --git a/nixos/boxes/kelder/default.nix b/nixos/boxes/kelder/default.nix index 8af7fe0..a69d81a 100644 --- a/nixos/boxes/kelder/default.nix +++ b/nixos/boxes/kelder/default.nix @@ -121,6 +121,7 @@ in username = "token"; passwordFile = config.age.secrets."kelder/ddclient-cloudflare.key".path; }; + samba = { enable = true; enableNmbd = true; @@ -135,6 +136,20 @@ in }; }; 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 = { @@ -245,6 +260,8 @@ in firewall = { trustedInterfaces = [ "ctrs" ]; + tcp.allowed = [ 25565 ]; + udp.allowed = [ 25565 ]; nat = { enable = true; externalInterface = "{ et1g0, estuary }"; diff --git a/nixos/modules/tmproot.nix b/nixos/modules/tmproot.nix index 0dcbe95..9593d90 100644 --- a/nixos/modules/tmproot.nix +++ b/nixos/modules/tmproot.nix @@ -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 { my.tmproot.persistence.config.directories = [ "/var/lib/samba"