{ system, self, pkgs, ... }: let runtimeInputs = [ pkgs.dash pkgs.curl pkgs.jq pkgs.nodejs_22 (pkgs.postgresql_16.withPackages (ps: [ ps.pgvector ])) pkgs.redis ]; check = name: extra: pkgs.runCommand name ({ nativeBuildInputs = runtimeInputs; AFFINE_PACKAGE = self.packages.${system}.affine; AFFINE_CLIENT_TEST = ./test/client.cjs; } // extra) '' dash ${./test/runtime.sh} touch "$out" ''; in pkgs.lib.optionalAttrs (system == "x86_64-linux") { affine-ai-usage = import ./ai-usage.nix { inherit self system pkgs; }; affine-model-picker = pkgs.runCommand "affine-model-picker" {} '' test -s ${self.packages.${system}.affine-frontend-static}/index.html touch "$out" ''; affine-runtime = check "affine-runtime" {}; affine-typography = check "affine-typography" { nativeBuildInputs = runtimeInputs ++ [ pkgs.playwright-driver ]; PLAYWRIGHT_CORE_PATH = "${pkgs.playwright-driver}"; PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}"; AFFINE_TYPOGRAPHY_TEST = ./test/typography.cjs; AFFINE_TYPOGRAPHY_PATCH = ../../../package/affine/gitea-document-typography.patch; }; }