From 115ee1e957b96a36a54f2567d4b8d4a60246924a Mon Sep 17 00:00:00 2001 From: Drew Haven Date: Sun, 6 Sep 2026 10:39:38 -0700 Subject: [PATCH] [WargameVODs] Adds hourly sync service. --- system/hosts/mcp/containers.nix | 10 +++++++++- .../containers/blazestar.net/wargame-vods.nix | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/system/hosts/mcp/containers.nix b/system/hosts/mcp/containers.nix index 6b9d3f2..ef80dd3 100644 --- a/system/hosts/mcp/containers.nix +++ b/system/hosts/mcp/containers.nix @@ -45,17 +45,25 @@ type = with types; uniq str; default = "/var/run/docker.sock"; example = "/var/run/docker.sock"; - description = "Path to the container management deamon's socket."; + description = "Path to the container management deamon's socket"; + }; + container-bin = mkOption { + type = with types; uniq package; + default = pkgs.docker; + example = "pkgs.docker"; + description = "The package used to interact with the container system"; }; }; config = { # local = { # container-backend = "docker"; + # container-bin = pkgs.docker; # container-socket = "/var/run/docker.sock"; # }; local = { container-backend = "podman"; + container-bin = pkgs.podman; container-socket = "/var/run/podman/podman.sock"; }; diff --git a/system/hosts/mcp/containers/blazestar.net/wargame-vods.nix b/system/hosts/mcp/containers/blazestar.net/wargame-vods.nix index 9e65683..af4d295 100644 --- a/system/hosts/mcp/containers/blazestar.net/wargame-vods.nix +++ b/system/hosts/mcp/containers/blazestar.net/wargame-vods.nix @@ -42,4 +42,22 @@ in config.sops.templates."wargame-vods.env".path ]; }; + + systemd = { + timers.wargame-vods-import = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "hourly"; + Persistent = false; # Do not catch up if timers were missed + RandomizedDelaySec = "5m"; # Jitter so it doesn't get synced up with anything else. + }; + }; + services.wargame-vods-import = { + description = "Hourly wargame-vods import"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${config.local.container-bin}/bin/docker exec wargame-vods /proc/1/exe sync"; + }; + }; + }; }