Update shell.nix

Use same setup as on other projects and expose php and composer to
shell for development.
This commit is contained in:
Daniel Siepmann 2023-08-28 15:37:43 +02:00
parent 4cb2b9ad80
commit 29357d8abd

View file

@ -1,14 +1,27 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
let 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 { projectInstall = pkgs.writeShellApplication {
name = "project-install"; name = "project-install";
runtimeInputs = [ runtimeInputs = [
pkgs.php82 php
pkgs.php82Packages.composer composer
]; ];
text = '' text = ''
composer install --prefer-dist --no-progress --working-dir="$PROJECT_ROOT" rm -rf .Build/ vendor/ composer.lock
composer update --prefer-dist --no-progress --working-dir="$PROJECT_ROOT"
''; '';
}; };
projectTestAcceptance = pkgs.writeShellApplication { projectTestAcceptance = pkgs.writeShellApplication {
@ -18,7 +31,7 @@ let
pkgs.sqlite pkgs.sqlite
pkgs.firefox pkgs.firefox
pkgs.geckodriver pkgs.geckodriver
pkgs.php82 php
]; ];
text = '' text = ''
project-install project-install
@ -34,6 +47,9 @@ let
in pkgs.mkShell { in pkgs.mkShell {
name = "TYPO3 Extension ThüCAT"; name = "TYPO3 Extension ThüCAT";
buildInputs = [ buildInputs = [
php
composer
projectInstall
projectTestAcceptance projectTestAcceptance
]; ];