From 7c9deda2c7cd085a4bc6d488d69b352292ba9674 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Thu, 24 Apr 2025 15:02:53 +0200 Subject: [PATCH] chore: adds sample for base plausible install --- modules/services/plausible.nix | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/services/plausible.nix diff --git a/modules/services/plausible.nix b/modules/services/plausible.nix new file mode 100644 index 0000000..e704fb1 --- /dev/null +++ b/modules/services/plausible.nix @@ -0,0 +1,35 @@ +{ + config, + ... +}: +let + domain = "statistics.liv.town"; +in +{ + services = { + nginx.virtualHosts.${domain} = { + forceSSL = true; + enableACME = true; + locations."/".proxyPass = "http://127.0.0.1:${toString config.services.plausible.server.port}"; + }; + + plausible = { + enable = true; + + adminUser = { + # activate is used to skip the email verification of the admin-user that's + # automatically created by plausible. This is only supported if + # postgresql is configured by the module. This is done by default, but + # can be turned off with services.plausible.database.postgres.setup. + activate = true; + email = "${config.liv.email}"; + # passwordFile = config.age.secrets.plausibleAdminPassword.path; + }; + + server = { + baseUrl = "https://${domain}"; + # secretKeybaseFile = config.age.secrets.plausibleSecretKeybase.path; + }; + }; + }; +}