forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv.nix
93 lines (83 loc) · 2.6 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ pkgs, lib, config, ... }:
{
packages = [
pkgs.gnupatch
pkgs.nodePackages_latest.yalc
];
languages.javascript.enable = true;
languages.javascript.package = lib.mkDefault pkgs.nodejs-18_x;
languages.php.enable = true;
languages.php.package = lib.mkDefault (pkgs.php.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ amqp redis blackfire grpc ];
extraConfig = ''
memory_limit = 2G
pdo_mysql.default_socket=''${MYSQL_UNIX_PORT}
mysqli.default_socket=''${MYSQL_UNIX_PORT}
blackfire.agent_socket = "${config.services.blackfire.socket}";
realpath_cache_ttl=3600
session.gc_probability=0
session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379/0"
display_errors = On
error_reporting = E_ALL
assert.active=0
opcache.memory_consumption=256M
opcache.interned_strings_buffer=20
zend.assertions = 0
short_open_tag = 0
zend.detect_unicode=0
realpath_cache_ttl=3600
'';
});
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.caddy.enable = lib.mkDefault true;
services.caddy.virtualHosts."http://localhost:8000" = {
extraConfig = ''
root * public
php_fastcgi unix/${config.languages.php.fpm.pools.web.socket}
file_server
'';
};
services.mysql.enable = lib.mkDefault true;
services.mysql.initialDatabases = [
{ name = "shopware"; }
{ name = "shopware_test"; }
];
services.mysql.ensureUsers = [
{
name = "shopware";
password = "shopware";
ensurePermissions = {
"shopware.*" = "ALL PRIVILEGES";
"shopware_test.*" = "ALL PRIVILEGES";
};
}
];
services.mysql.settings = {
mysqld = {
log_bin_trust_function_creators = 1;
};
};
services.redis.enable = lib.mkDefault true;
services.adminer.enable = lib.mkDefault true;
services.adminer.listen = lib.mkDefault "127.0.0.1:9080";
services.mailhog.enable = lib.mkDefault true;
# services.elasticsearch.enable = true;
# services.rabbitmq.enable = true;
# services.rabbitmq.managementPlugin.enable = true;
# Environment variables
env.APP_URL = lib.mkDefault "http://localhost:8000";
env.APP_SECRET = lib.mkDefault "devsecret";
env.CYPRESS_baseUrl = lib.mkDefault "http://localhost:8000";
env.DATABASE_URL = lib.mkDefault "mysql://root@localhost:3306/shopware";
env.MAILER_URL = lib.mkDefault "smtp://localhost:1025";
}