2025-12-23 10:19:37 +01:00
|
|
|
{
|
|
|
|
|
description = "matomo-bootstrap";
|
2025-12-23 12:58:48 +01:00
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
};
|
|
|
|
|
|
2025-12-23 10:19:37 +01:00
|
|
|
outputs = { self, nixpkgs }:
|
2025-12-23 12:58:48 +01:00
|
|
|
let
|
|
|
|
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
packages = forAllSystems (system:
|
|
|
|
|
let
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
python = pkgs.python312;
|
|
|
|
|
in
|
|
|
|
|
rec {
|
|
|
|
|
matomo-bootstrap = python.pkgs.buildPythonApplication {
|
|
|
|
|
pname = "matomo-bootstrap";
|
2025-12-23 13:33:39 +01:00
|
|
|
version = "1.0.0"; # keep in sync with pyproject.toml
|
2025-12-23 12:58:48 +01:00
|
|
|
pyproject = true;
|
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
|
|
# Runtime deps (Python)
|
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
|
|
|
|
playwright
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Optional: keep tests off in nix build by default
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
meta = with pkgs.lib; {
|
|
|
|
|
description = "Headless bootstrap tooling for Matomo (installation + API token provisioning)";
|
|
|
|
|
homepage = "https://github.com/kevinveenbirkenbach/matomo-bootstrap";
|
|
|
|
|
license = licenses.mit;
|
|
|
|
|
mainProgram = "matomo-bootstrap";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
default = matomo-bootstrap;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
apps = forAllSystems (system:
|
|
|
|
|
let
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
matomo = self.packages.${system}.matomo-bootstrap;
|
|
|
|
|
|
|
|
|
|
playwright-install = pkgs.writeShellApplication {
|
|
|
|
|
name = "matomo-bootstrap-playwright-install";
|
|
|
|
|
runtimeInputs = [ matomo ];
|
|
|
|
|
text = ''
|
|
|
|
|
# Installs the Playwright Chromium browser into the user cache.
|
|
|
|
|
# This is needed when the Matomo instance is not installed yet and
|
|
|
|
|
# the web installer must be driven via Playwright.
|
|
|
|
|
exec ${matomo}/bin/python -m playwright install chromium
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
matomo-bootstrap = {
|
|
|
|
|
type = "app";
|
|
|
|
|
program = "${matomo}/bin/matomo-bootstrap";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
matomo-bootstrap-playwright-install = {
|
|
|
|
|
type = "app";
|
|
|
|
|
program = "${playwright-install}/bin/matomo-bootstrap-playwright-install";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
default = self.apps.${system}.matomo-bootstrap;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
devShells = forAllSystems (system:
|
|
|
|
|
let
|
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
python = pkgs.python312;
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
|
packages = with pkgs; [
|
|
|
|
|
python
|
|
|
|
|
python.pkgs.ruff
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
2025-12-23 10:19:37 +01:00
|
|
|
};
|
|
|
|
|
}
|