Drupal: Difference between revisions

m Replace backticks with <code> blocks
 
(2 intermediate revisions 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 96: Line 96:
</syntaxhighlight>Files in this directory, because of their tendency to change during run time, cannot live inside of <code>/nix/store</code>, so they are placed here instead.  
</syntaxhighlight>Files in this directory, because of their tendency to change during run time, cannot live inside of <code>/nix/store</code>, so they are placed here instead.  


The webserver is the default owner of all files in the state directory and regular users are not permitted to access this directory by default. However, users who belong to the webserver group may edit or upload files as needed. Refer to "'''How To Access Files In The State Directory As A Regular User"''' for more information on how to add users to the webserver group.
The webserver is the default owner of all files in the state directory and regular users are not permitted to access this directory by default. However, users who belong to the webserver group may edit or upload files as needed. Refer to [[Drupal#How To Access Files In The State Directory As A Regular User|How To Access Files In The State Directory As A Regular User]] for more information on how to add users to the webserver group.


=== Uploading Modules and Themes ===
=== Uploading Modules and Themes ===
Line 102: Line 102:


This is not the officially [https://www.drupal.org/docs/extending-drupal/installing-modules recommended method] for installing contributed modules and themes, or modules and themes that have third-party dependencies. However, this functionality has been preserved both as an escape hatch, and to provide an easy way to manage a simple Drupal install that doesn't rely on [https://getcomposer.org/ composer].
This is not the officially [https://www.drupal.org/docs/extending-drupal/installing-modules recommended method] for installing contributed modules and themes, or modules and themes that have third-party dependencies. However, this functionality has been preserved both as an escape hatch, and to provide an easy way to manage a simple Drupal install that doesn't rely on [https://getcomposer.org/ composer].
=== 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<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.