Skip to content

Commit

Permalink
TASK: Add shell.nix for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
d-g-codappix committed Apr 11, 2024
1 parent 14ad109 commit 57f70f3
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{ pkgs ? import <nixpkgs> { } }:

let
php = pkgs.php82.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);

extraConfig = ''
xdebug.mode = debug
memory_limit = 4G
'';
};
inherit(pkgs.php82Packages) composer;

projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
php
composer
];
text = ''
rm -rf .Build/ vendor/ composer.lock
composer update --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
'';
};

projectCgl = pkgs.writeShellApplication {
name = "project-cgl";

runtimeInputs = [
php
];

text = ''
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --dry-run --diff
'';
};

projectCglFix = pkgs.writeShellApplication {
name = "project-cgl-fix";

runtimeInputs = [
php
];

text = ''
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix
'';
};

in pkgs.mkShell {
name = "TYPO3 Extension Responsive Images";
buildInputs = [
php
composer
projectInstall
projectCgl
projectCglFix
];

shellHook = ''
export PROJECT_ROOT="$(pwd)"
'';
}

0 comments on commit 57f70f3

Please sign in to comment.