about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2022-01-29 22:32:15 +0100
committerGitHub <noreply@github.com>2022-01-29 22:32:15 +0100
commit13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c (patch)
treecef5010a37654f258c70b3d4b8e54a34a153c0b9 /nixos/modules/services/web-apps
parent1ca0069b87fb41818e930d575986d1e88ed7fcb0 (diff)
parente211c94b94f0327958dae20537f43551e3a1a653 (diff)
downloadnixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar.gz
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar.bz2
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar.lz
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar.xz
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.tar.zst
nixlib-13f5c4c45b2b9842b5d7bcc13e33e70ca9d9256c.zip
Merge pull request #156731 from Ma27/bump-plausible
plausible: 1.4.0 -> 1.4.3
Diffstat (limited to 'nixos/modules/services/web-apps')
-rw-r--r--nixos/modules/services/web-apps/plausible.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/nixos/modules/services/web-apps/plausible.nix b/nixos/modules/services/web-apps/plausible.nix
index b6c48186a1d3..5d550ae5ca86 100644
--- a/nixos/modules/services/web-apps/plausible.nix
+++ b/nixos/modules/services/web-apps/plausible.nix
@@ -10,8 +10,7 @@ in {
     enable = mkEnableOption "plausible";
 
     releaseCookiePath = mkOption {
-      default = null;
-      type = with types; nullOr (either str path);
+      type = with types; either str path;
       description = ''
         The path to the file with release cookie. (used for remote connection to the running node).
       '';
@@ -235,6 +234,8 @@ in {
           script = ''
             export CONFIG_DIR=$CREDENTIALS_DIRECTORY
 
+            export RELEASE_COOKIE="$(< $CREDENTIALS_DIRECTORY/RELEASE_COOKIE )"
+
             # setup
             ${pkgs.plausible}/createdb.sh
             ${pkgs.plausible}/migrate.sh
@@ -243,10 +244,8 @@ in {
                 psql -d plausible <<< "UPDATE users SET email_verified=true;"
               fi
             ''}
-            ${optionalString (cfg.releaseCookiePath != null) ''
-              export RELEASE_COOKIE="$(< $CREDENTIALS_DIRECTORY/RELEASE_COOKIE )"
-            ''}
-            plausible start
+
+            exec plausible start
           '';
 
           serviceConfig = {
@@ -257,8 +256,8 @@ in {
             LoadCredential = [
               "ADMIN_USER_PWD:${cfg.adminUser.passwordFile}"
               "SECRET_KEY_BASE:${cfg.server.secretKeybaseFile}"
-            ] ++ lib.optionals (cfg.mail.smtp.passwordFile != null) [ "SMTP_USER_PWD:${cfg.mail.smtp.passwordFile}"]
-            ++ lib.optionals (cfg.releaseCookiePath != null) [ "RELEASE_COOKIE:${cfg.releaseCookiePath}"];
+              "RELEASE_COOKIE:${cfg.releaseCookiePath}"
+            ] ++ lib.optionals (cfg.mail.smtp.passwordFile != null) [ "SMTP_USER_PWD:${cfg.mail.smtp.passwordFile}"];
           };
         };
       }