40 lines
841 B
Nix
40 lines
841 B
Nix
{ inputs, ... }:
|
|
|
|
{
|
|
imports = [ inputs.process-compose.flakeModule ];
|
|
|
|
perSystem =
|
|
{ pkgs, ... }:
|
|
let
|
|
databasePort = 3306;
|
|
httpPort = 8888;
|
|
in
|
|
{
|
|
process-compose."default" = {
|
|
imports = [
|
|
inputs.services.processComposeModules.default
|
|
];
|
|
|
|
services = {
|
|
mysql."mysql" = {
|
|
enable = true;
|
|
|
|
initialDatabases = [
|
|
{ name = "drupal-lab"; }
|
|
];
|
|
|
|
settings.mysqld.port = toString databasePort;
|
|
};
|
|
};
|
|
|
|
settings.processes.php = {
|
|
command = pkgs.writeShellApplication {
|
|
name = "drush-server";
|
|
text = "vendor/bin/drush runserver ${toString httpPort}";
|
|
};
|
|
|
|
depends_on."mysql".condition = "process_healthy";
|
|
};
|
|
};
|
|
};
|
|
}
|