about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorDaniel Flanagan <daniel@lyte.dev>2024-03-29 16:23:18 -0500
committerDaniel Flanagan <daniel@lyte.dev>2024-05-04 10:28:21 -0500
commit8bb777ee378082942231f63a035923a475538030 (patch)
tree6daa3f21b8849f94e3b49146238ec2e7725f72cf /nixos
parentad12944445f0b09737a1592fbd256bfbade7e790 (diff)
plausible: Do not run createdb.sh unless configured to setup the database
Closes #300088
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-apps/plausible.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixos/modules/services/web-apps/plausible.nix b/nixos/modules/services/web-apps/plausible.nix
index a6bb81e0b73f7..b2b2583f1a13d 100644
--- a/nixos/modules/services/web-apps/plausible.nix
+++ b/nixos/modules/services/web-apps/plausible.nix
@@ -276,8 +276,11 @@ in {
             ${lib.optionalString (cfg.mail.smtp.passwordFile != null)
               ''export SMTP_USER_PWD="$(< $CREDENTIALS_DIRECTORY/SMTP_USER_PWD )"''}
 
-            # setup
-            ${cfg.package}/createdb.sh
+            ${lib.optionalString cfg.database.postgres.setup ''
+              # setup
+              ${cfg.package}/createdb.sh"
+            ''}
+
             ${cfg.package}/migrate.sh
             export IP_GEOLOCATION_DB=${pkgs.dbip-country-lite}/share/dbip/dbip-country-lite.mmdb
             ${cfg.package}/bin/plausible eval "(Plausible.Release.prepare() ; Plausible.Auth.create_user(\"$ADMIN_USER_NAME\", \"$ADMIN_USER_EMAIL\", \"$ADMIN_USER_PWD\"))"