-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevenv.nix
60 lines (52 loc) · 1.39 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
{ pkgs, config, ... }:
{
env.MAGE_IS_DEVELOPER_MODE = 1;
env.DEV_PHP_STRICT = 1;
hosts = {
"openmage.test" = "127.0.0.1";
};
packages = [ pkgs.git pkgs.gnupatch pkgs.n98-magerun ];
languages.php.enable = true;
languages.php.package = pkgs.php82.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ xdebug redis ];
extraConfig = ''
memory_limit = 512m
opcache.memory_consumption = 256M
opcache.interned_strings_buffer = 20
'';
};
languages.php.fpm.pools.web = {
settings = {
"clear_env" = "no";
"pm" = "dynamic";
"pm.max_children" = 5;
"pm.start_servers" = 2;
"pm.min_spare_servers" = 1;
"pm.max_spare_servers" = 5;
};
};
services.mailhog.enable = true;
services.redis.enable = true;
services.redis.port = 6379;
services.caddy.enable = true;
services.caddy.virtualHosts."http://openmage.test:80" = {
extraConfig = ''
root * pub
php_fastcgi unix/${config.languages.php.fpm.pools.web.socket}
file_server
'';
};
services.mysql.enable = true;
services.mysql.settings.mysqld.port = 3306;
services.mysql.initialDatabases = [{ name = "openmage"; }];
services.mysql.ensureUsers = [
{
name = "openmage";
password = "openmage";
ensurePermissions = { "openmage.*" = "ALL PRIVILEGES"; };
}
];
enterShell = ''
composer install
'';
}