Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddy and PHP next level #77

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ in {

enterShell = ''
versionCheck

${pkgs.caddy}/bin/caddy trust 2> /dev/null
'';

# Environment variables
Expand All @@ -194,8 +196,8 @@ in {
MAILER_URL = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";
MAILER_DSN = lib.mkDefault "smtp://127.0.0.1:1025?encryption=&auth_mode=";

APP_URL = lib.mkDefault "http://127.0.0.1:8000";
CYPRESS_baseUrl = lib.mkDefault "http://127.0.0.1:8000";
APP_URL = lib.mkDefault "http://127.0.0.1";
CYPRESS_baseUrl = lib.mkDefault "http://127.0.0.1";

APP_SECRET = lib.mkDefault "devsecret";

Expand Down
4 changes: 3 additions & 1 deletion modules/caddy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ let
}

file_server

encode zstd gzip
}

log {
Expand All @@ -64,7 +66,7 @@ let
vhostConfig
];

vhostDomains = cfg.additionalServerAlias ++ [ "127.0.0.1" ];
vhostDomains = cfg.additionalServerAlias ++ [ "127.0.0.1" "localhost" ];

caddyHostConfig = (lib.mkMerge
(lib.forEach vhostDomains (domain: {
Expand Down
5 changes: 4 additions & 1 deletion modules/php.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ let
display_startup_errors = true
error_reporting = E_ALL
html_errors = true
max_execution_time = 60
max_input_time = 60
assert.active = 0
zend.detect_unicode = 0
opcache.memory_consumption = 256M
Expand All @@ -38,6 +40,7 @@ let

phpPackage = package.buildEnv {
extensions = { all, enabled }: with all; enabled
++ [ grpc ]
++ (lib.optional config.services.redis.enable redis)
++ (lib.optional config.services.blackfire.enable blackfire)
++ (lib.optional config.services.rabbitmq.enable amqp)
Expand All @@ -47,7 +50,7 @@ let

phpXdebug = package.buildEnv {
extensions = { all, enabled }: with all; enabled
++ [ xdebug ]
++ [ xdebug grpc ]
++ (lib.optional config.services.redis.enable redis)
++ (lib.optional config.services.rabbitmq.enable amqp)
++ lib.attrsets.attrValues (lib.attrsets.getAttrs cfg.additionalPhpExtensions package.extensions);
Expand Down
Loading