matomo!
This commit is contained in:
parent
1a53db8ce1
commit
91509baa59
6 changed files with 82 additions and 24 deletions
47
modules/services/matomo.nix
Normal file
47
modules/services/matomo.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, pkgs, options, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.services.matomo;
|
||||
in {
|
||||
options.modules.services.matomo = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
default = "analytics.reidlab.pink";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
matomo = {
|
||||
enable = true;
|
||||
package = pkgs.matomo-beta;
|
||||
|
||||
periodicArchiveProcessing = true;
|
||||
hostname = cfg.domain;
|
||||
nginx = {
|
||||
serverAliases = [ cfg.domain ];
|
||||
enableACME = true;
|
||||
};
|
||||
};
|
||||
|
||||
# matomo doesn't automatically create the database
|
||||
# just. make sure its named matomo
|
||||
mysql = {
|
||||
ensureDatabases = [ "matomo" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "matomo";
|
||||
ensurePermissions = {
|
||||
"matomo.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue