From dafa4f59ec4b8e782ce30599d52bc94d1fcaa85e Mon Sep 17 00:00:00 2001 From: s-prechtl Date: Mon, 31 Mar 2025 23:39:32 +0200 Subject: [PATCH] feat: announcement --- hosts/hitsugibune/configuration.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hosts/hitsugibune/configuration.nix b/hosts/hitsugibune/configuration.nix index b8ed68e..5d35f4a 100644 --- a/hosts/hitsugibune/configuration.nix +++ b/hosts/hitsugibune/configuration.nix @@ -95,13 +95,19 @@ in { 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}''; - }; + ExecStart = '' + for i in {1..5}; do + mcrcon -H localhost -P 25566 -p "whatisloveohbabydonthurtmedonthurtmenomore" '/title @a title {"text":"This server runs on NixOS","color":"blue","bold":true}'; + sleep 1; # Wait 2 seconds between announcements + done + ''; }; systemd.timers.mc-announcement = { description = "Run Minecraft Announcement every hour"; + enable = true; wantedBy = ["timers.target"]; + after = ["mc-aged.service"]; timerConfig = { OnCalendar = "hourly"; # Change this as needed Persistent = true;