58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
makeWrapper,
|
|
php,
|
|
uploadLimits ? import ../upload-limits.nix,
|
|
}:
|
|
|
|
let
|
|
phpPackage = php.buildEnv {
|
|
extensions =
|
|
{ enabled, all }:
|
|
enabled
|
|
++ [
|
|
all.pdo_pgsql
|
|
];
|
|
extraConfig = uploadLimits.phpOptions;
|
|
};
|
|
in
|
|
phpPackage.buildComposerProject2 (finalAttrs: {
|
|
pname = "rabbi-gerzi-backend";
|
|
version = "0.0.0";
|
|
|
|
src = lib.cleanSourceWith {
|
|
src = ../../backend;
|
|
filter =
|
|
path: type:
|
|
let
|
|
relativePath = lib.removePrefix (toString ../../backend + "/") (toString path);
|
|
in
|
|
!(
|
|
lib.hasPrefix ".env" relativePath
|
|
|| lib.hasPrefix "vendor/" relativePath
|
|
|| lib.hasPrefix ".phpunit" relativePath
|
|
|| lib.hasPrefix "storage/logs/" relativePath
|
|
|| lib.hasPrefix "storage/framework/views/" relativePath
|
|
|| lib.hasSuffix "~" relativePath
|
|
);
|
|
};
|
|
|
|
php = phpPackage;
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
vendorHash = "sha256-EhBxKo3qjEuVTlxK/F+vx6ZBGbApBjcgOK8+3u8UiNk=";
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/bin
|
|
makeWrapper ${phpPackage}/bin/php $out/bin/rabbi-gerzi-artisan \
|
|
--add-flags "$out/share/php/${finalAttrs.pname}/artisan"
|
|
'';
|
|
|
|
passthru = {
|
|
php = phpPackage;
|
|
};
|
|
|
|
meta = {
|
|
description = "Rabbi Gerzi Laravel backend";
|
|
mainProgram = "rabbi-gerzi-artisan";
|
|
};
|
|
})
|