Jump to content

Matomo: Difference between revisions

From NixOS Wiki
Klinger (talk | contribs)
link to manual and changed categories
Lennart (talk | contribs)
Update from matomo2nix to matomo4nix
Line 5: Line 5:
== Plugins ==
== Plugins ==


To use plugins one can use [https://git.helsinki.tools/helsinki-systems/matomo2nix matomo2nix]
To use plugins one can use [https://git.helsinki.tools/helsinki-systems/matomo4nix matomo4nix].


<syntaxHighlight lang=nix>
<syntaxhighlight lang="nix" line="1">{ pkgs, lib, ...}:
matomoPackages = (callPackage (builtins.fetchGit {
let
  url = "https://git.helsinki.tools/helsinki-systems/matomo2nix";
 
  ref = "master";
  matomoPackages = (pkgs.callPackage (builtins.fetchGit {
}) {}) // {
    url = "https://git.helsinki.tools/helsinki-systems/matomo4nix";
  withPlugins = matomoPkg: pluginPkgs: runCommand "matomo-with-plugins" {} ''
    ref = "master";
    cp -a ${matomoPkg}/. $out
  }) {}) // {
    find $out -type d -exec chmod 755 {} +
    withPlugins = matomoPkg: pluginPkgs: pkgs.runCommand "matomo-with-plugins" {} ''
    for i in ${lib.concatStringsSep " " pluginPkgs}; do
      cp -a ${matomoPkg}/. $out
      cp -a $i/. $out
      find $out -type d -exec chmod 755 {} +
    done
      for i in ${lib.concatStringsSep " " pluginPkgs}; do
  '';
        cp -a $i/. $out
};
      done
</syntaxHighlight>
    '';
  };
 
in {
 
  services.matomo = {
    enable = true;
    hostname = "TODO;
    package = matomoPackages.withPlugins pkgs.matomo (
      with matomoPackages.plugins;
      [
        RebelOIDC
      ]
    );
  };
 
}</syntaxhighlight>


[[Category:Web Applications]]
[[Category:Web Applications]]
[[Category:Server]]
[[Category:Server]]
[[Category:NixOS Manual]]
[[Category:NixOS Manual]]

Revision as of 19:11, 19 August 2025

Matomo (source code) is a real-time web analytics platform.

This article extends the documentation in the NixOS manual.

Plugins

To use plugins one can use matomo4nix.

{ pkgs, lib, ...}:
let

  matomoPackages = (pkgs.callPackage (builtins.fetchGit {
    url = "https://git.helsinki.tools/helsinki-systems/matomo4nix";
    ref = "master";
  }) {}) // {
    withPlugins = matomoPkg: pluginPkgs: pkgs.runCommand "matomo-with-plugins" {} ''
      cp -a ${matomoPkg}/. $out
      find $out -type d -exec chmod 755 {} +
      for i in ${lib.concatStringsSep " " pluginPkgs}; do
        cp -a $i/. $out
      done
    '';
  };

in {

  services.matomo = {
    enable = true;
    hostname = "TODO;
    package = matomoPackages.withPlugins pkgs.matomo (
      with matomoPackages.plugins;
      [
        RebelOIDC
      ]
    );
  };

}