services.myWebsites.commons.stats = {
enable = lib.mkEnableOption "enable statistics";
sites = lib.mkOption {
- # FIXME: specify
- type = lib.types.listOf (lib.types.unspecified);
+ type = lib.types.listOf (lib.types.submodule {
+ options = {
+ conf = lib.mkOption { type = lib.types.path; };
+ name = lib.mkOption { type = lib.types.string; };
+ };
+ });
default = [];
description = "Sites to generate stats";
};
goaccess $TMPFILE --no-progress -o /var/lib/goaccess/${domain}/index.html -p ${conf}
'';
in "${d}/bin/stats-${domain}";
- # FIXME: running several goaccess simultaneously seems to be
- # bugged?
in
pkgs.lib.lists.imap0 (i: v: "${toString (i+5)} 0 * * * root ${stats v.name v.conf}") cfg.sites;
};
- # FIXME: initial sync
system.activationScripts.goaccess = ''
mkdir -p /var/lib/goaccess
'' +