mirror of
https://github.com/werkraum-media/form_file_collection.git
synced 2024-12-08 23:36:12 +01:00
91 lines
1.8 KiB
Nix
91 lines
1.8 KiB
Nix
{
|
|
pkgs ? import <nixpkgs> { }
|
|
}:
|
|
|
|
let
|
|
php = pkgs.php82.buildEnv {
|
|
extensions = { enabled, all }: enabled ++ (with all; [
|
|
xdebug
|
|
]);
|
|
|
|
extraConfig = ''
|
|
xdebug.mode = debug
|
|
memory_limit = 4G
|
|
'';
|
|
};
|
|
inherit(php.packages) composer;
|
|
|
|
projectInstall = pkgs.writeShellApplication {
|
|
name = "project-install";
|
|
runtimeInputs = [
|
|
php
|
|
composer
|
|
];
|
|
text = ''
|
|
rm -rf .Build/ vendor/
|
|
composer install --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
|
|
'';
|
|
};
|
|
projectValidateComposer = pkgs.writeShellApplication {
|
|
name = "project-validate-composer";
|
|
runtimeInputs = [
|
|
php
|
|
composer
|
|
];
|
|
text = ''
|
|
composer validate
|
|
'';
|
|
};
|
|
projectValidateXml = pkgs.writeShellApplication {
|
|
name = "project-validate-xml";
|
|
runtimeInputs = [
|
|
pkgs.libxml2
|
|
pkgs.wget
|
|
projectInstall
|
|
];
|
|
text = ''
|
|
project-install
|
|
xmllint --schema vendor/phpunit/phpunit/phpunit.xsd --noout phpunit.xml.dist
|
|
'';
|
|
};
|
|
projectCodingGuideline = pkgs.writeShellApplication {
|
|
name = "project-coding-guideline";
|
|
runtimeInputs = [
|
|
php
|
|
projectInstall
|
|
];
|
|
text = ''
|
|
project-install
|
|
./vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
'';
|
|
};
|
|
projectCodingGuidelineFix = pkgs.writeShellApplication {
|
|
name = "project-coding-guideline-fix";
|
|
runtimeInputs = [
|
|
php
|
|
projectInstall
|
|
];
|
|
text = ''
|
|
project-install
|
|
./vendor/bin/php-cs-fixer fix
|
|
'';
|
|
};
|
|
|
|
in pkgs.mkShell {
|
|
name = "TYPO3 Extension FormFileCollection";
|
|
buildInputs = [
|
|
projectInstall
|
|
projectValidateComposer
|
|
projectValidateXml
|
|
projectCodingGuideline
|
|
projectCodingGuidelineFix
|
|
php
|
|
composer
|
|
];
|
|
|
|
shellHook = ''
|
|
export PROJECT_ROOT="$(pwd)"
|
|
|
|
export typo3DatabaseDriver=pdo_sqlite
|
|
'';
|
|
}
|