-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Add shell.nix for local testing
- Loading branch information
1 parent
14ad109
commit 57f70f3
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)" | ||
''; | ||
} |