plausible init
This commit is contained in:
27
modules/servers/plausible.nix
Normal file
27
modules/servers/plausible.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
setup = import ../factories/mkserver.nix { inherit lib config; };
|
||||
cfg = config.my.servers.plausible;
|
||||
in
|
||||
{
|
||||
options.my.servers.plausible = setup.mkOptions "plausible" "analytics" 8439;
|
||||
config = lib.mkIf (cfg.enable && config.my.secureHost) {
|
||||
sops.secrets.plausible.sopsFile = ../../secrets/keys.yaml;
|
||||
services.plausible = {
|
||||
inherit (cfg) enable;
|
||||
database.postgres.socket = config.my.postgresSocket;
|
||||
mail.email = config.my.smtpemail;
|
||||
server = {
|
||||
inherit (cfg) port;
|
||||
baseUrl = cfg.url;
|
||||
listenAddress = cfg.ip;
|
||||
secretKeybaseFile = config.sops.secrets.plausible.path;
|
||||
disableRegistration = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user