Set of modules to quickly configure a Shopware development environment:
- Launch multiple instances simultaneously without port conflicts
- Use self-signed certificates for https, including trusting them in your environment
- Use an SSL proxy to share trusted certificates with platform projects and application servers simultaneously
- QoL enhancements and pre-configured tools
Put this as your devenv.local.nix:
{ ... }: let
modules = builtins.fetchGit {
url = "https://github.com/cyl3x/shopware-devenv";
ref = "devenv";
rev = "<current-commit-sha>";
};
in {
imports = [modules.outPath];
shopware.enable = true;
shopware.port = 3000;
shopware.ssl.standalone.enable = true;
# if not set, the domain is derived from the directory name (`platform_` is stripped)
# shopware.domain = "dev.localhost";
}devenv.local.nix inside a platform project:
{ ... }: let
modules = builtins.fetchGit {
url = "https://github.com/cyl3x/shopware-devenv";
ref = "devenv";
rev = "<current-commit-sha>";
};
in {
imports = [modules.outPath];
shopware.enable = true;
shopware.port = 3000;
# Read more about it below under "Options"
shopware.ssl.proxy.enable = true;
# Devenv folder of the proxy server. If not set, the parent directory is assumed
# shopware.ssl.proxy.devenv = "../.devenv"
}devenv.nix somewhere, e.g. in a parent directory next to all platform projects and app servers:
{ ... }: let
modules = builtins.fetchGit {
url = "https://github.com/cyl3x/shopware-devenv";
ref = "devenv";
rev = "<current-commit-sha>";
};
in {
imports = [modules.outPath];
shopware-proxy = {
enable = true;
port = 2000; # port to start poxy on
platforms = {
# base port and domain as set in platform directory
"trunk.localhost" = 3000;
# some other platform projects
"65.localhost" = 3100;
"66.localhost" = 3200;
"saas.localhost" = 3300;
};
apps = {
"swagbraintree.localhost" = 8080;
};
};
}-
consolecan be used to execute console command in any directory -
caddy-setcapcan be used to bind privileged ports (like 443). Can only be used on non-nixos systems -
vscode-wscan be used to generate a VS Code workspace file. Setshopware.extras.vscode-workspace.enable = true;. -
update-modulecan be used to update to the newest SHA. Pass a SHA as argument to update to a specific SHA. -
update-modulescan be used to update alldevenv.local.nixto the newest SHA. (Proxy config only) (searches with max-depth = 1) -
Env
APP_URL_HTTPreferences the http url, ifAPP_URLis https -
Env
DATABASE_URL_TESTreferences the test database, useful for executing console commands on it
List of all available configurations with this module set.
Enable and configure all Shopware related services.
Type: boolean
Default:
false
Declared by:
The domain on which Shopware will be available.
A subdomain of localhost will be derived based on the directory name.
Type: string
Default:
"<part-of-dirname>.localhost"
Declared by:
Enable FrankenPHP. HIGHLY EXPERIMENTAL!
Type: unspecified value
Default:
false
Declared by:
Enable configure monolog, muting or redirecting channels.
Type: boolean
Default:
false
Declared by:
List of channels to be logged in an extra file.
Type: list of string
Default:
[
"paypal"
"request"
]
Declared by:
List of channels to be muted.
Type: list of string
Default:
[
"cache"
"deprecation"
"event"
"paypal"
"request"
"lock"
]
Declared by:
Enable to start the ssl proxy server together with devenv.
Type: boolean
Default:
false
Declared by:
Enable to generate a vscode workspace file.
It also includes all plugins, to regenerate the file use vscode-ws
Type: boolean
Default:
false
Declared by:
List of plugin folder names exlcuded from the workspace
Type: list of string
Default:
[ ]
Declared by:
Adds a phpunit wrapper for recca0120.vscode-phpunit so it can find phpunit in plugins
Type: boolean
Default:
true
Declared by:
Enable configuration for the admin-watcher.
Type: boolean
Default:
true
Declared by:
Enable and configure adminer.
Type: boolean
Default:
true
Declared by:
Enable blackfire agent and configuration.
Credentials have to be set via services.blackfire.{client-id,client-token,server-id,server-token}.
These can be found at https://blackfire\.io/my/settings/credentials\.
Type: boolean
Default:
false
Declared by:
Port for blackfire’s socket to listen on.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
3011
Declared by:
Enable cypress and necessary configuration.
Type: boolean
Default:
false
Declared by:
Enable elasticsearch and necessary configuration.
Type: boolean
Default:
false
Declared by:
Enable mailpit and necessary configuration.
Type: boolean
Default:
true
Declared by:
Enable running a message consumer.
Type: boolean
Default:
false
Declared by:
Additional arguments to pass to the messenger consumer.
Type: list of string
Default:
[
"-vv --all"
]
Declared by:
The time limit in seconds the worker can handle new messages. The messenger will restart after this time.
Type: signed integer
Default:
300
Declared by:
Enable mysql and necessary configuration.
Type: boolean
Default:
true
Declared by:
Enable configuration for playwright. A playwright command will be available.
Use for systems like NixOS, where npx run playwight install not work.
Type: boolean
Default:
true
Declared by:
Enable rabbitmq and necessary configuration.
Type: boolean
Default:
false
Declared by:
Enable redis and necessary configuration.
Type: boolean
Default:
true
Declared by:
Enable configuration for the store-watcher
Type: boolean
Default:
true
Declared by:
Enable configuration for the var-dump-server. Will also create a shotcut dump-server.
Type: boolean
Default:
true
Declared by:
Enable Xdebug for PHP.
Type: boolean
Default:
true
Declared by:
Enable Xdebug logging. Alternatively, set the log level.
Type: signed integer or boolean
Default:
false
Declared by:
Port for Xdebug to listen on.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
3010
Declared by:
The base port on which Shopware will be available. All sub services will be derived from this port.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
3000
Declared by:
Wrapper to use bin/console in any directory.
Type: boolean
Default:
true
Declared by:
Enable creation of a trusted root cert for node.js and php.
Type: boolean
Default:
false
Declared by:
Enable ssl via proxy. Shopware will be available via https by default. Used domain will taken from shopware.domain.
No other webserver configuration will be done, it’s assumed that a second devenv instance is running as proxy. See shopware-proxy.enable for more information.
Type: boolean
Default:
false
Declared by:
Path to the devenv instance that serves as proxy.
Type: string
Default:
"/../.devenv"
Declared by:
Port on which the proxy runs.
Type: null or 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
2000
Declared by:
Enable standalone ssl. Shopware will be available via https by default. A fallback port can be defined for http. Self signed certificates will generated by caddy.
Type: boolean
Default:
false
Declared by:
Fallback port for http
Type: null or 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
3080
Declared by:
Enable the proxy used for shopware and app servers.
Type: boolean
Default:
false
Declared by:
Map of app servers to proxy.
Type: attribute set of 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
{ }
Declared by:
Enable reverse proxy for the admin-watcher.
Type: boolean
Default:
true
Declared by:
Enable reverse proxy for adminer.
Type: boolean
Default:
true
Declared by:
Enable reverse proxy for mailpit.
Type: boolean
Default:
true
Declared by:
Enable reverse proxy for rabbitmq management.
Type: boolean
Default:
false
Declared by:
Enable reverse proxy for the store-watcher.
Type: boolean
Default:
true
Declared by:
Map of platform projects to proxy.
Type: attribute set of 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
{ }
Example:
''
{
"trunk.localhost" = 3000; # base port of platform, defined by `shopware.port`
"66.localhost" = 4000;
}
''
Declared by:
Port on which the proxy listens.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
2000
Declared by: