From 565a729f7cbc33f3c99536b844aaeba80dd1bafd Mon Sep 17 00:00:00 2001 From: ppom Date: Sun, 14 Aug 2022 16:53:42 +0200 Subject: [PATCH] make plausible service start after clickhouse service Plausible fails on start because clickhouse is not ready, when clickhouse has low CPU available, eg. ```nix {systemd.services.clickhouse.serviceConfig.CPUWeight = 20;} ``` Fixed with ```nix {systemd.services.plausible.after = [ "clickhouse.service" ];} ``` --- nixos/modules/services/web-apps/plausible.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/plausible.nix b/nixos/modules/services/web-apps/plausible.nix index 6f098134c922..e06fa769ef2c 100644 --- a/nixos/modules/services/web-apps/plausible.nix +++ b/nixos/modules/services/web-apps/plausible.nix @@ -188,7 +188,11 @@ in { inherit (pkgs.plausible.meta) description; documentation = [ "https://plausible.io/docs/self-hosting" ]; wantedBy = [ "multi-user.target" ]; - after = optionals cfg.database.postgres.setup [ "postgresql.service" "plausible-postgres.service" ]; + after = optional cfg.database.clickhouse.setup "clickhouse.service" + ++ optionals cfg.database.postgres.setup [ + "postgresql.service" + "plausible-postgres.service" + ]; requires = optional cfg.database.clickhouse.setup "clickhouse.service" ++ optionals cfg.database.postgres.setup [ "postgresql.service"