made php with own module
This commit is contained in:
parent
da033d8d09
commit
bace5f0669
@ -3,31 +3,6 @@
|
||||
|
||||
let
|
||||
personalization = import ./modules/personalization.nix;
|
||||
|
||||
|
||||
custom-php = pkgs.php.buildEnv {
|
||||
extensions = { enabled, all }: enabled ++ (with all; [ bz2 apcu redis imagick memcached ]);
|
||||
extraConfig = ''
|
||||
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
max_execution_time = 10000
|
||||
max_input_time = 3000
|
||||
memory_limit = 1G;
|
||||
opcache.enable=1;
|
||||
opcache.memory_consumption=512;
|
||||
opcache_revalidate_freq = 240;
|
||||
opcache.max_accelerated_files=20000;
|
||||
post_max_size = 3G
|
||||
upload_max_filesize = 3G
|
||||
apc.enable_cli=1
|
||||
opcache.interned_strings_buffer = 64
|
||||
redis.session.locking_enabled=1
|
||||
redis.session.lock_retries=-1
|
||||
redis.session.lock_wait_time=10000
|
||||
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
@ -103,18 +78,7 @@ in
|
||||
description = "free";
|
||||
extraGroups = [ "networkmanager" ];
|
||||
};
|
||||
|
||||
|
||||
####### PHP user for PHPFPM #######
|
||||
php = {
|
||||
isSystemUser = true;
|
||||
createHome = false;
|
||||
uid = 7777;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.php.group = "php";
|
||||
users.groups.php = {};
|
||||
|
||||
# Enable automatic login for the user.
|
||||
services.displayManager.autoLogin.enable = true;
|
||||
@ -167,7 +131,6 @@ in
|
||||
lm_sensors
|
||||
hunspell
|
||||
hunspellDicts.en_US
|
||||
custom-php
|
||||
matrix-synapse-tools.synadm
|
||||
brave
|
||||
dua
|
||||
@ -204,25 +167,6 @@ in
|
||||
};
|
||||
|
||||
|
||||
####### PHPFMP #######
|
||||
services.phpfpm.pools = {
|
||||
mypool = {
|
||||
user = "caddy";
|
||||
group = "php";
|
||||
phpPackage = custom-php;
|
||||
settings = {
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
"pm.start_servers" = 10;
|
||||
"pm.min_spare_servers" = 5;
|
||||
"pm.max_spare_servers" = 20;
|
||||
"pm.max_requests" = 500;
|
||||
"clear_env" = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
####### CADDY #######
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
imports = [
|
||||
|
||||
./php.nix
|
||||
./synapse.nix
|
||||
./coturn.nix
|
||||
./bitcoinecosystem.nix
|
||||
|
66
modules/php.nix
Normal file
66
modules/php.nix
Normal file
@ -0,0 +1,66 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
|
||||
let
|
||||
|
||||
custom-php = pkgs.php.buildEnv {
|
||||
extensions = { enabled, all }: enabled ++ (with all; [ bz2 apcu redis imagick memcached ]);
|
||||
extraConfig = ''
|
||||
|
||||
display_errors = On
|
||||
display_startup_errors = On
|
||||
max_execution_time = 10000
|
||||
max_input_time = 3000
|
||||
memory_limit = 1G;
|
||||
opcache.enable=1;
|
||||
opcache.memory_consumption=512;
|
||||
opcache_revalidate_freq = 240;
|
||||
opcache.max_accelerated_files=20000;
|
||||
post_max_size = 3G
|
||||
upload_max_filesize = 3G
|
||||
apc.enable_cli=1
|
||||
opcache.interned_strings_buffer = 64
|
||||
redis.session.locking_enabled=1
|
||||
redis.session.lock_retries=-1
|
||||
redis.session.lock_wait_time=10000
|
||||
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
users.users = {
|
||||
|
||||
php = {
|
||||
isSystemUser = true;
|
||||
createHome = false;
|
||||
uid = 7777;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.php.group = "php";
|
||||
|
||||
users.groups.php = {};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
custom-php
|
||||
];
|
||||
|
||||
services.phpfpm.pools = {
|
||||
mypool = {
|
||||
user = "caddy";
|
||||
group = "php";
|
||||
phpPackage = custom-php;
|
||||
settings = {
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 75;
|
||||
"pm.start_servers" = 10;
|
||||
"pm.min_spare_servers" = 5;
|
||||
"pm.max_spare_servers" = 20;
|
||||
"pm.max_requests" = 500;
|
||||
"clear_env" = "no";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user