export nix module
This commit is contained in:
parent
fee174ec05
commit
e288b3a63b
6 changed files with 522 additions and 4 deletions
55
nix/packages/backend.nix
Normal file
55
nix/packages/backend.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
lib,
|
||||
makeWrapper,
|
||||
php,
|
||||
}:
|
||||
|
||||
let
|
||||
phpPackage = php.withExtensions (
|
||||
{ enabled, all }:
|
||||
enabled
|
||||
++ [
|
||||
all.pdo_pgsql
|
||||
]
|
||||
);
|
||||
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";
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue