Drupal: Difference between revisions

m State Directory: Update anchor link
 
(One intermediate revision by the same user not shown)
Line 64: Line 64:


=== Database Configuration ===
=== Database Configuration ===
The NixOS implementation of Drupal uses MySQL as the primary database, however you can [https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-connect-to-multiple-databases-within-drupal#s-drupal-8 add other databases using settings.php]. Refer to the '''Configuration Using settings.php''' section above for instructions on how to add extra settings to <code>settings.php</code>.
The NixOS implementation of Drupal uses MySQL as the primary database, however you can [https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-connect-to-multiple-databases-within-drupal#s-drupal-8 add other databases using settings.php]. Refer to the [[Drupal#Configuration Using settings.php|Configuration Using settings.php]] section above for instructions on how to add extra settings to <code>settings.php</code>.


Using nix, you can configure the database that gets created in NixOS at install time by using this configuration interface:<syntaxhighlight lang="nix">
Using nix, you can configure the database that gets created in NixOS at install time by using this configuration interface:<syntaxhighlight lang="nix">
Line 104: Line 104:


=== Changing The Location Of The State Directory ===
=== Changing The Location Of The State Directory ===
If you want the state directory to be located in a different part of the system, you can use the following configuration to change where it is created
If you want the state directory to be located in a different part of the system, you can use the following configuration to change where it is created<syntaxhighlight lang="nix">
services.drupal.sites."localhost".stateDir = /path/to/custom/state/dir;
</syntaxhighlight>'''Note''': Changing the state directory does not automatically change the location of the <code>modules</code>, <code>themes</code>, <code>config</code>, or <code>files</code> directories. You can override those locations by using the <code>modulesDir</code> and <code>themesDir</code>, <code>configDir</code>, <code>filesDir</code> keys, accordingly.