matomo: refactor into single package file

This commit is contained in:
Niklas Korz 2025-01-15 11:47:35 +01:00
parent d7ac52bd81
commit 83eb8d8020
3 changed files with 156 additions and 181 deletions

View file

@ -5,11 +5,7 @@
}:
with import ../lib/testing-python.nix { inherit system pkgs; };
with pkgs.lib;
let
matomoTest =
package:
makeTest {
name = "matomo";
@ -17,7 +13,6 @@ let
{ config, pkgs, ... }:
{
services.matomo = {
package = package;
enable = true;
nginx = {
forceSSL = false;
@ -57,19 +52,14 @@ let
machine.sleep(1)
machine.wait_for_unit("phpfpm-matomo.service")
'';
};
in
{
matomo = matomoTest pkgs.matomo // {
name = "matomo";
meta.maintainers =
with maintainers;
with pkgs.lib.maintainers;
[
florianjacob
mmilata
twey
boozedog
]
++ lib.teams.flyingcircus.members;
};
++ pkgs.lib.teams.flyingcircus.members;
}

View file

@ -7,27 +7,13 @@
nixosTests,
}:
let
versions = {
matomo = {
version = "5.2.1";
hash = "sha256-5glMwwIG0Uo8bu904u40FUa+yaUlrQe1nUCkv9/ATks=";
};
};
common =
pname:
{
version,
hash,
beta ? null,
}:
stdenv.mkDerivation (finalAttrs: {
name = "${pname}-${finalAttrs.version}";
version = version + lib.optionalString (beta != null) "-${toString beta}";
pname = "matomo";
version = "5.2.1";
src = fetchurl {
url = "https://builds.matomo.org/matomo-${finalAttrs.version}.tar.gz";
inherit hash;
hash = "sha256-5glMwwIG0Uo8bu904u40FUa+yaUlrQe1nUCkv9/ATks=";
};
nativeBuildInputs = [ makeWrapper ];
@ -104,7 +90,9 @@ let
'';
passthru = {
tests = nixosTests.matomo."${pname}";
tests = lib.optionalAttrs stdenv.hostPlatform.isLinux {
inherit (nixosTests) matomo;
};
};
meta = with lib; {
@ -123,6 +111,4 @@ let
]
++ teams.flyingcircus.members;
};
});
in
lib.mapAttrs common versions
})

View file

@ -11882,8 +11882,7 @@ with pkgs;
};
tt-rss = callPackage ../servers/tt-rss { };
inherit (callPackages ../servers/web-apps/matomo {})
matomo;
matomo = callPackage ../servers/web-apps/matomo { };
unpackerr = callPackage ../servers/unpackerr {
inherit (darwin.apple_sdk.frameworks) Cocoa WebKit;