-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevenv.nix
76 lines (69 loc) · 1.8 KB
/
devenv.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
{ pkgs, ... }:
let
phpCustom = pkgs.php82.buildEnv {
# List of php extension required
extensions =
{ all, enabled }:
with all;
enabled
++ [
imagick
pcov
];
};
in
{
# https://devenv.sh/basics/
env.OVERMIND_SKIP_ENV = true;
# https://devenv.sh/packages/
packages = [
(pkgs.frankenphp.override { php = phpCustom; })
pkgs.php82Extensions.xdebug
pkgs.php82Packages.phive
pkgs.nodejs-slim_18
pkgs.yarn
pkgs.zip
];
# https://devenv.sh/languages/
languages.php = {
enable = true;
package = phpCustom;
};
# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = {
nixfmt-rfc-style.enable = true;
prettier = {
enable = true;
package = null; # use version managed by yarn
entry = "node_modules/.bin/prettier --ignore-unknown --list-different --write";
};
php-cs-fixer = {
enable = true;
package = null; # use version managed by phive
entry = "tools/php-cs-fixer --config=.php-cs-fixer.dist.php fix";
};
phpstan = {
enable = true;
package = null; # use version managed by composer
entry = "vendor/bin/phpstan --memory-limit=-1 analyze";
excludes = [
"^config/secrets/.+"
"^tests/.+"
".php-cs-fixer.dist.php"
"deploy.dist.php"
];
};
# Custom hooks not provided by devenv
twig-lint = {
enable = true;
entry = "bin/console lint:twig";
types = [ "twig" ];
};
};
# https://devenv.sh/reference/options/#processimplementation
process.implementation = "overmind";
# https://devenv.sh/processes/
processes.asset.exec = "yarn run dev";
processes.web.exec = "frankenphp php-server --root public --listen :8000";
# See full reference at https://devenv.sh/reference/options/
}