feat: minecraft server announcements

This commit is contained in:
s-prechtl 2025-03-31 23:33:27 +02:00
parent b7c237f798
commit ecd5b757a4
2 changed files with 20 additions and 3 deletions

View file

@ -91,5 +91,22 @@ in {
};
};
systemd.services.mc-announcement = {
description = "Minecraft Server Announcement";
serviceConfig = {
Type = "oneshot";
ExecStart = ''mcrcon -H localhost -P 25566 -p "whatisloveohbabydonthurtmedonthurtmenomore" '/title @a title {"text":"This server runs on NixOS","color":"blue","bold":true}'';
};
};
systemd.timers.mc-announcement = {
description = "Run Minecraft Announcement every hour";
wantedBy = ["timers.target"];
timerConfig = {
OnCalendar = "hourly"; # Change this as needed
Persistent = true;
};
};
system.stateVersion = "24.11";
}