nixos/oauth2-proxy: restart service when keyFile option changes

(cherry picked from commit 0b30b27e1b)
This commit is contained in:
Sandro Jäckel 2024-06-16 19:13:47 +02:00 committed by github-actions[bot]
parent 70d8f7aa3f
commit 71004159f4

View File

@ -586,11 +586,11 @@ in
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ] ++ lib.optionals needsKeycloak [ "keycloak.service" ];
after = [ "network-online.target" ] ++ lib.optionals needsKeycloak [ "keycloak.service" ];
restartTriggers = [ cfg.keyFile ];
serviceConfig = {
User = "oauth2-proxy";
Restart = "always";
ExecStart = "${cfg.package}/bin/oauth2-proxy ${configString}";
ExecStart = "${lib.getExe cfg.package} ${configString}";
EnvironmentFile = lib.mkIf (cfg.keyFile != null) cfg.keyFile;
};
};