Skip to content

Commit

Permalink
NEXT-24538 - Update devenv
Browse files Browse the repository at this point in the history
  • Loading branch information
shyim committed Feb 8, 2023
1 parent 00a88c2 commit abb0b27
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 57 deletions.
18 changes: 9 additions & 9 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1674583310,
"narHash": "sha256-CeiZASfC8yOsFArBW4hfp3uLCcWyWk1dw8XwCz2pxpo=",
"lastModified": 1675875772,
"narHash": "sha256-sYXHPZ4tsjdG+UXK0mYnABhiS/RuzHiV9uGOU9YakwE=",
"owner": "cachix",
"repo": "devenv",
"rev": "6a4e78b6af7aef298dfb82007a62686833e3a9e8",
"rev": "eac5eb12eb42765f5f252972dc876d1f96b03dfe",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -71,11 +71,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1674361931,
"narHash": "sha256-lUIZItHbW+LmJAz9V9puLq2rHlewcUgg1RPehkQIkzc=",
"lastModified": 1675698036,
"narHash": "sha256-BgsQkQewdlQi8gapJN4phpxkI/FCE/2sORBaFcYbp/A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ef479383e13698c8d5ccf8a608485dc8ce1d4f80",
"rev": "1046c7b92e908a1202c0f1ba3fc21d19e1cf1b62",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -112,11 +112,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1674550893,
"narHash": "sha256-HXI8AB96PP7UZ7iPANACXM8qc9eMz0ljxBEDM8JJKhY=",
"lastModified": 1675688762,
"narHash": "sha256-oit/SxMk0B380ASuztBGQLe8TttO1GJiXF8aZY9AYEc=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "7bdf85f6bbef581eb687838d19f2b35a4c9d77f0",
"rev": "ab608394886fb04b8a5df3cb0bab2598400e3634",
"type": "github"
},
"original": {
Expand Down
106 changes: 58 additions & 48 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,80 @@
pkgs.nodePackages_latest.yalc
];

languages.javascript.enable = true;
languages.javascript.package = lib.mkDefault pkgs.nodejs-18_x;
languages.javascript = {
enable = lib.mkDefault true;
package = lib.mkDefault pkgs.nodejs-18_x;
};

languages.php = {
enable = lib.mkDefault true;
version = lib.mkDefault "8.1";
extensions = lib.mkDefault [ "grpc" ];

languages.php.enable = true;
languages.php.package = lib.mkDefault (pkgs.php.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ amqp redis blackfire grpc ];
extraConfig = ''
ini = lib.mkDefault ''
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
realpath_cache_ttl = 3600
session.gc_probability = 0
${lib.optionalString config.services.redis.enable ''
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
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
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;
fpm.pools.web = lib.mkDefault {
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.caddy = {
enable = lib.mkDefault true;

virtualHosts.":8000" = lib.mkDefault {
extraConfig = lib.mkDefault ''
@default {
not path /theme/* /media/* /thumbnail/* /bundles/* /css/* /fonts/* /js/* /sitemap/*
}
root * public
php_fastcgi @default unix/${config.languages.php.fpm.pools.web.socket}
file_server
'';
};
};

services.mysql.enable = lib.mkDefault true;
services.mysql.initialDatabases = [
{ name = "shopware"; }
];
services.mysql.ensureUsers = [
{
name = "shopware";
password = "shopware";
ensurePermissions = {
"shopware.*" = "ALL PRIVILEGES";
"shopware_test.*" = "ALL PRIVILEGES";
services.mysql = {
enable = true;
initialDatabases = lib.mkDefault [{ name = "shopware"; }];
ensureUsers = lib.mkDefault [
{
name = "shopware";
password = "shopware";
ensurePermissions = {
"shopware.*" = "ALL PRIVILEGES";
"shopware_test.*" = "ALL PRIVILEGES";
};
}
];
settings = {
mysqld = {
log_bin_trust_function_creators = 1;
};
}
];
services.mysql.settings = {
mysqld = {
log_bin_trust_function_creators = 1;
};
};

Expand Down

0 comments on commit abb0b27

Please sign in to comment.