Laravel connects to the production postgres database through PDO, so the runtime interpreter must include pdo_pgsql. Without it, tide-migrate fails on activation with 'could not find driver' and phpfpm-tide never starts.
32 lines
821 B
Nix
32 lines
821 B
Nix
{ php84, lib }:
|
|
let
|
|
# Laravel connects to Postgres via PDO, so the runtime PHP must
|
|
# ship pdo_pgsql. The default php84 set ships pdo, pdo_mysql, and
|
|
# pdo_sqlite but not pdo_pgsql. buildEnv gives us a php with the
|
|
# extra extension that flows through to passthru.php and the
|
|
# composer build hooks.
|
|
php = php84.buildEnv {
|
|
extensions = ({ enabled, all }: enabled ++ [ all.pdo_pgsql ]);
|
|
};
|
|
in
|
|
php.buildComposerProject (finalAttrs: {
|
|
pname = "tide-backend";
|
|
version = "0.1.0";
|
|
|
|
src = lib.cleanSource ../../backend;
|
|
|
|
composerNoDev = true;
|
|
composerNoPlugins = true;
|
|
composerNoScripts = true;
|
|
|
|
vendorHash = "sha256-OYpfX435tPJqiOzQPpWPXCVH1rTeQ74dGuNVyk6+c1A=";
|
|
|
|
passthru = {
|
|
inherit php;
|
|
};
|
|
|
|
meta = {
|
|
description = "TIDE Laravel backend";
|
|
license = lib.licenses.mit;
|
|
};
|
|
})
|