aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nixops/modules/websites/commons/stats.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixops/modules/websites/commons/stats.nix b/nixops/modules/websites/commons/stats.nix
index b5bf0e0..e2c1e62 100644
--- a/nixops/modules/websites/commons/stats.nix
+++ b/nixops/modules/websites/commons/stats.nix
@@ -55,8 +55,15 @@ in {
55 goaccess $TMPFILE --no-progress -o /var/lib/goaccess/${domain}/index.html -p ${conf} 55 goaccess $TMPFILE --no-progress -o /var/lib/goaccess/${domain}/index.html -p ${conf}
56 ''; 56 '';
57 in "${d}/bin/stats-${domain}"; 57 in "${d}/bin/stats-${domain}";
58 allStats = sites: pkgs.writeScript "stats" ''
59 #!${pkgs.stdenv.shell}
60
61 ${builtins.concatStringsSep "\n" (map (v: stats v.name v.conf) sites)}
62 '';
58 in 63 in
59 pkgs.lib.lists.imap0 (i: v: "${toString (i+5)} 0 * * * root ${stats v.name v.conf}") cfg.sites; 64 [
65 "5 0 * * * root ${allStats cfg.sites}"
66 ];
60 }; 67 };
61 68
62 system.activationScripts.goaccess = '' 69 system.activationScripts.goaccess = ''