Drupal: Difference between revisions
m Fix typos, extend shell script instructions |
Add new hostname config |
||
| Line 162: | Line 162: | ||
}; | }; | ||
</syntaxhighlight><blockquote>'''Note:''' The database settings configured in NixOS will merely create the database, they will not instruct a new Drupal installation where to find the database. Either define your database settings in <code>settings.php</code>, or see [[Drupal#After_Installation| After Installation]] for an example of how to do this with nix.</blockquote> | </syntaxhighlight><blockquote>'''Note:''' The database settings configured in NixOS will merely create the database, they will not instruct a new Drupal installation where to find the database. Either define your database settings in <code>settings.php</code>, or see [[Drupal#After_Installation| After Installation]] for an example of how to do this with nix.</blockquote> | ||
=== Hostname Configuration === | |||
The hostname string configured under <code>services.drupal.sites.<sitename></code> can be used to create a publicly accessible hostname for your website. However, the Drupal service does not do this by default. | |||
In order to modify your <code>/etc/hosts</code> file, use this configuration in conjunction with your site config. | |||
<syntaxhighlight lang="nix"> | |||
services.drupal = { | |||
enable = true; | |||
sites = { | |||
"mysite.com" = { | |||
enable = true; | |||
}; | |||
}; | |||
}; | |||
# Enumerate our custom host into /etc/hosts | |||
networking.hosts = { | |||
"127.0.0.1" = ["localhost" "mysite.com"]; | |||
}; | |||
</syntaxhighlight> | |||
== State Directory == | == State Directory == | ||