about summary refs log tree commit diff
path: root/ops/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ops/modules')
-rw-r--r--ops/modules/oauth2_proxy.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/ops/modules/oauth2_proxy.nix b/ops/modules/oauth2_proxy.nix
index 423f9010c5d2..58b3a222a80d 100644
--- a/ops/modules/oauth2_proxy.nix
+++ b/ops/modules/oauth2_proxy.nix
@@ -19,6 +19,10 @@ let
     reverse_proxy = true
     set_xauthrequest = true
   '';
+
+  # Depend on the Keycloak service if it is running on the same
+  # machine.
+  depends_on = lib.optional config.services.keycloak.enable "keycloak.service";
 in
 {
   options.services.depot.oauth2_proxy = {
@@ -40,6 +44,8 @@ in
   config = lib.mkIf cfg.enable {
     systemd.services.oauth2_proxy = {
       inherit description;
+      after = depends_on;
+      wants = depends_on;
       wantedBy = [ "multi-user.target" ];
 
       serviceConfig = {