workshop-typo3/shell.nix

45 lines
1.1 KiB
Nix

{ pkgs ? import <nixpkgs> { } }:
let
projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
pkgs.php82
pkgs.php82Packages.composer
];
text = ''
composer install --working-dir="$PROJECT_ROOT"
'';
};
projectUpdate = pkgs.writeShellApplication {
name = "project-update";
runtimeInputs = [
pkgs.php82
pkgs.php82Packages.composer
];
text = ''
rm -rf "$PROJECT_ROOT/public/typo3/" "$PROJECT_ROOT/public/index.php" "$PROJECT_ROOT/vendor/" "$PROJECT_ROOT/tags"
composer update --with-all-dependencies --working-dir="$PROJECT_ROOT"
"$PROJECT_ROOT/vendor/bin/typo3" cache:flush
"$PROJECT_ROOT/vendor/bin/typo3" cache:warmup
"$PROJECT_ROOT/vendor/bin/typo3" upgrade:run
composer audit
'';
};
in pkgs.mkShell {
name = "MyTypo3Website";
buildInputs = [
projectInstall
projectUpdate
pkgs.php82
pkgs.php82Packages.composer
];
TYPO3_DATABASE = "typo3_workshop";
shellHook = ''
export PROJECT_ROOT="$(pwd)"
'';
}