about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/plausible.nix
diff options
context:
space:
mode:
authorppom <ppom@ppom.me>2022-08-14 16:53:42 +0200
committerppom <ppom@ppom.me>2022-08-14 17:09:05 +0200
commit565a729f7cbc33f3c99536b844aaeba80dd1bafd (patch)
tree4caeed8eaf7b50aedaea049bbb26d886dc910673 /nixos/modules/services/web-apps/plausible.nix
parent91a403bdf818b68377e49e75bc9ed443703adcb5 (diff)
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" ];}
```
Diffstat (limited to 'nixos/modules/services/web-apps/plausible.nix')
-rw-r--r--nixos/modules/services/web-apps/plausible.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/plausible.nix b/nixos/modules/services/web-apps/plausible.nix
index 6f098134c9226..e06fa769ef2cf 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"