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

This commit is contained in:
Sandro Jäckel 2024-06-16 19:13:47 +02:00
parent 5654a7d013
commit 0b30b27e1b
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

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;
};
};