Some checks are pending
Weekly NixOS Build & Cache / build-and-cache (push) Has started running
28 lines
727 B
Nix
28 lines
727 B
Nix
{
|
|
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/secrets.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;
|
|
};
|
|
};
|
|
};
|
|
}
|