mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-20 03:40:29 +05:00
Add plausible
This commit is contained in:
parent
0af7d3e6a4
commit
445ad3c38e
|
@ -18,6 +18,8 @@
|
||||||
./programs/synapse.nix
|
./programs/synapse.nix
|
||||||
./programs/fail2ban.nix
|
./programs/fail2ban.nix
|
||||||
./programs/maddy.nix
|
./programs/maddy.nix
|
||||||
|
./programs/plausible.nix
|
||||||
|
./programs/clickhouse.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable flakes
|
# Enable flakes
|
||||||
|
|
6
nixos/programs/clickhouse.nix
Normal file
6
nixos/programs/clickhouse.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
services.clickhouse = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -58,6 +58,17 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Plausible
|
||||||
|
"plausible.comfycamp.space" = {
|
||||||
|
useACMEHost = "comfycamp.space";
|
||||||
|
forceSSL = true;
|
||||||
|
locations = {
|
||||||
|
"/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:55005";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Mail: MTA-STS
|
# Mail: MTA-STS
|
||||||
"mta-sts.comfycamp.space" = {
|
"mta-sts.comfycamp.space" = {
|
||||||
useACMEHost = "comfycamp.space";
|
useACMEHost = "comfycamp.space";
|
||||||
|
|
49
nixos/programs/plausible.nix
Normal file
49
nixos/programs/plausible.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
services.plausible = {
|
||||||
|
enable = true;
|
||||||
|
releaseCookiePath = "/var/lib/secrets/plausible/release-cookie.txt";
|
||||||
|
database.postgres = {
|
||||||
|
setup = false;
|
||||||
|
dbname = "plausible";
|
||||||
|
};
|
||||||
|
database.clickhouse = {
|
||||||
|
setup = false;
|
||||||
|
url = "http://localhost:8123/plausible";
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
baseUrl = "https://plausible.comfycamp.space";
|
||||||
|
port = 55005;
|
||||||
|
secretKeybaseFile = "/var/lib/secrets/plausible/keybase.txt";
|
||||||
|
};
|
||||||
|
adminUser = {
|
||||||
|
name = "lumin";
|
||||||
|
email = "lumin@comfycamp.space";
|
||||||
|
passwordFile = "/var/lib/secrets/plausible/admin-pass.txt";
|
||||||
|
};
|
||||||
|
mail = {
|
||||||
|
email = "plausible@comfycamp.space";
|
||||||
|
smtp = {
|
||||||
|
enableSSL = true;
|
||||||
|
hostAddr = "comfycamp.space";
|
||||||
|
hostPort = 465;
|
||||||
|
passwordFile = "/var/lib/secrets/plausible/smtp-pass.txt";
|
||||||
|
user = "plausible@comfycamp.space";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.plausible.script = lib.mkForce ''
|
||||||
|
export CONFIG_DIR=$CREDENTIALS_DIRECTORY
|
||||||
|
|
||||||
|
export RELEASE_COOKIE="$(< $CREDENTIALS_DIRECTORY/RELEASE_COOKIE )"
|
||||||
|
|
||||||
|
# Do not create the database.
|
||||||
|
# https://github.com/plausible/analytics/issues/405
|
||||||
|
# ${config.services.plausible.package}/createdb.sh
|
||||||
|
|
||||||
|
${config.services.plausible.package}/migrate.sh
|
||||||
|
|
||||||
|
exec plausible start
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue