feat: wowmine: immersive portals

This commit is contained in:
2026-11-24 09:05:38 +00:00
parent 8c42bef13f
commit 05198a98f8
44 changed files with 1517 additions and 5 deletions
@@ -41,6 +41,16 @@ let
trap '${restore name server}' EXIT
unit=${lib.escapeShellArg server.service}
if ${pkgs.systemd}/bin/systemctl is-active --quiet "$unit"; then
${lib.optionalString (server.announcementCommand != null) ''
${lib.escapeShellArg (toString server.announcementCommand)} \
"[Backup] Server will stop for backup in 5 minutes."
${pkgs.coreutils}/bin/sleep 240
${lib.escapeShellArg (toString server.announcementCommand)} \
"[Backup] Server will stop for backup in 1 minute."
${pkgs.coreutils}/bin/sleep 60
${lib.escapeShellArg (toString server.announcementCommand)} \
"[Backup] Server is stopping now to save a backup."
''}
${pkgs.coreutils}/bin/touch "$state_dir/restart-needed"
${pkgs.systemd}/bin/systemctl stop "$unit"
if [ "$(${pkgs.systemd}/bin/systemctl show "$unit" -p Result --value)" != success ]; then
@@ -108,6 +118,11 @@ in {
enable = lib.mkOption { type = lib.types.bool; default = true; };
service = lib.mkOption { type = lib.types.str; };
directory = lib.mkOption { type = lib.types.str; };
announcementCommand = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = "Executable receiving one chat message argument. Enables warnings five minutes, one minute and immediately before stopping an active server.";
};
exclude = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [