-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdevenv.nix
More file actions
54 lines (48 loc) · 1.23 KB
/
devenv.nix
File metadata and controls
54 lines (48 loc) · 1.23 KB
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
{ pkgs, config, ... }:
{
languages.php.enable = true;
languages.php.package = pkgs.php84.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ redis pdo_mysql xdebug ];
extraConfig = ''
memory_limit = -1
max_execution_time = 0
xdebug.mode = debug
xdebug.client_port = 9003
xdebug.start_with_request = yes
xdebug.discover_client_host = true
opcache.enable = false
'';
};
languages.php.fpm.pools.web = {
settings = {
"clear_env" = "no";
"pm" = "dynamic";
"pm.max_children" = 10;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 10;
};
};
services.mysql.enable = true;
services.mysql.initialDatabases = [
{
name = "app";
}
];
services.redis.enable = true;
services.caddy.enable = true;
services.caddy.virtualHosts.":8000" = {
extraConfig = ''
root * public
php_fastcgi unix/${config.languages.php.fpm.pools.web.socket}
file_server
'';
};
env.DATABASE_URL = "mysql://root@127.0.0.1/app?version=mariadb-10.11.5";
env.REDIS_DSN = "redis://localhost:6379/0";
enterShell = ''
if [[ ! -d vendor ]]; then
composer install
fi
'';
}