From 02246e3b5d1ac1a00f4646cb29414e0e23302db2 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 16 Aug 2024 02:45:17 -0500 Subject: [PATCH] fix(hosts/luna): make gitea actions depend on gitea service --- hosts/luna/modules/services/gitea.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hosts/luna/modules/services/gitea.nix b/hosts/luna/modules/services/gitea.nix index cd0adea3..8ed6f9af 100644 --- a/hosts/luna/modules/services/gitea.nix +++ b/hosts/luna/modules/services/gitea.nix @@ -3,6 +3,7 @@ fqdn, inputs, pkgs, + lib, ... }: let @@ -137,6 +138,17 @@ in }; }; + # TODO: Upstream the below to Nixpkgs. If the runner is using the exact same url as the gitea + # service and both are on the same host, then the runner should have a systemd dependency on the + # gitea service. + systemd.services.gitea-actions-default.requires = lib.mkIf ( + config.services.gitea.enable + && ( + config.services.gitea-actions-runner.instances.default.url + == config.services.gitea.settings.server.ROOT_URL + ) + ) [ "gitea.service" ]; + networking.firewall.allowedTCPPorts = [ config.services.gitea.settings.server.SSH_PORT ]; environment.persistence.save.directories = [