From d6c7a522efbf614769e9ce10e76acc95666f4a5c Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Fri, 8 Dec 2023 10:36:18 -0600 Subject: [PATCH] refactor(luna): delay gitlab-docker start in systemd --- hosts/luna/modules/docker/gitlab.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hosts/luna/modules/docker/gitlab.nix b/hosts/luna/modules/docker/gitlab.nix index 4f71712..17f874f 100644 --- a/hosts/luna/modules/docker/gitlab.nix +++ b/hosts/luna/modules/docker/gitlab.nix @@ -7,6 +7,16 @@ in environment.persistence.save.directories = [ gitlab_home ]; + + systemd.timers.delay-gitlab-start = { + after = [ "docker.service" "docker.socket" "network-online.target" ]; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnActiveSec = "30sec"; + Unit = "docker-gitlab.service"; + }; + }; + virtualisation.oci-containers.containers.gitlab = { image = "gitlab/gitlab-ee:latest"; autoStart = true; @@ -26,6 +36,8 @@ in ]; }; + systemd.services.docker-gitlab.after = [ "delay-gitlab.timer" ]; + networking.firewall.allowedTCPPorts = [ 2222 ];