feat: minecraft server announcements
This commit is contained in:
parent
b7c237f798
commit
ecd5b757a4
2 changed files with 20 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ in {
|
|||
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
networking.firewall.allowedUDPPorts = [ 24454 ];
|
||||
networking.firewall.allowedUDPPorts = [24454];
|
||||
|
||||
services.modded-minecraft-servers = {
|
||||
# This is mandatory, sorry.
|
||||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:let
|
||||
}: let
|
||||
serverIP = "192.168.0.201";
|
||||
in{
|
||||
in {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue