mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-08-11 05:42:33 +02:00
treewide: add missing systemd ordering directives
In particular, we were missing `sops-install-secrets.service` in a ton of places, and `network-online.target` for some homebrewn services. This has caused failure of some services on machine startup.
This commit is contained in:
@@ -79,6 +79,11 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.grafana = {
|
||||
after = [ "sops-install-secrets.service" ];
|
||||
requires = [ "sops-install-secrets.service" ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${cfg.settings.server.domain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
|
||||
@@ -37,9 +37,15 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.prometheus-postgres-exporter-knakelibrak.serviceConfig = let
|
||||
localCfg = config.services.prometheus.exporters.postgres;
|
||||
in lib.recursiveUpdate config.systemd.services.prometheus-postgres-exporter.serviceConfig {
|
||||
systemd.services.prometheus-postgres-exporter-knakelibrak = {
|
||||
after = [ "sops-install-secrets.service" ];
|
||||
requires = [ "sops-install-secrets.service" ];
|
||||
|
||||
# TODO: is it really necessary to use recursiveUpdate on the entire attrset here?
|
||||
# Why don't we just update the relevant attrs directly?
|
||||
serviceConfig = let
|
||||
localCfg = config.services.prometheus.exporters.postgres;
|
||||
in lib.recursiveUpdate config.systemd.services.prometheus-postgres-exporter.serviceConfig {
|
||||
EnvironmentFile = config.sops.secrets."keys/postgres/postgres_exporter_knakelibrak_env".path;
|
||||
ExecStart = ''
|
||||
${pkgs.prometheus-postgres-exporter}/bin/postgres_exporter \
|
||||
@@ -48,4 +54,5 @@ in {
|
||||
${lib.concatStringsSep " \\\n " localCfg.extraFlags}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user