forked from extcode/cart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
95 lines (81 loc) · 1.73 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
pkgs ? import <nixpkgs> { }
,phpVersion ? "php81"
}:
let
php = pkgs.${phpVersion}.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);
extraConfig = ''
xdebug.mode = debug
memory_limit = 4G
'';
};
inherit(pkgs."${phpVersion}Packages") composer;
projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
php
composer
];
text = ''
composer update --prefer-dist --no-progress
'';
};
projectCgl = pkgs.writeShellApplication {
name = "project-cgl";
runtimeInputs = [
php
];
text = ''
./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --diff
'';
};
projectCglFix = pkgs.writeShellApplication {
name = "project-cgl-fix";
runtimeInputs = [
php
];
text = ''
./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php
'';
};
projectTestUnit = pkgs.writeShellApplication {
name = "project-test-unit";
runtimeInputs = [
php
projectInstall
];
text = ''
project-install
.build/bin/phpunit -c Build/UnitTests.xml
'';
};
projectTestFunctional = pkgs.writeShellApplication {
name = "project-test-functional";
runtimeInputs = [
php
projectInstall
];
text = ''
project-install
.build/bin/phpunit -c Build/FunctionalTests.xml
'';
};
in pkgs.mkShell {
name = "TYPO3 Extension cart";
buildInputs = [
php
composer
projectInstall
projectCgl
projectCglFix
projectTestUnit
projectTestFunctional
];
shellHook = ''
export PROJECT_ROOT="$(pwd)"
export typo3DatabaseDriver=pdo_sqlite
'';
}