WordPress: Difference between revisions
imported>Onny Add required httpd configuration |
imported>Onny Add language configuration options |
||
| Line 13: | Line 13: | ||
Visit http://localhost to setup your new Wordpress instance. By default, a Mysql server is configured automatically so you won't have to setup the database backend. | Visit http://localhost to setup your new Wordpress instance. By default, a Mysql server is configured automatically so you won't have to setup the database backend. | ||
<syntaxHighlight lang="nix"> | |||
{ pkgs, ... }: let | |||
language-de = pkgs.stdenv.mkDerivation { | |||
name = "language-de"; | |||
src = pkgs.fetchurl { | |||
url = "https://de.wordpress.org/wordpress-6.0.1-de_DE.tar.gz"; | |||
sha256 = "sha256-dlas0rXTSV4JAl8f/UyMbig57yURRYRhTMtJwF9g8h0="; | |||
}; | |||
installPhase = "mkdir -p $out; cp -r ./wp-content/languages/* $out/"; | |||
}; | |||
in { | |||
services.httpd.adminAddr = "hello@example.org"; | |||
services.wordpress.sites."localhost" = { | |||
enable = true; | |||
languages = [ language-de ]; | |||
extraConfig = '' | |||
define ('WPLANG', 'de_DE'); | |||
''; | |||
}; | |||
} | |||
</syntaxHighlight> | |||
Make sure that the source of your language package corresponds to the Wordpress package version you're using. Consult the [https://translate.wordpress.org translation portal] of Wordpress for the specific country and language codes available. This example is using the code <code>de_DE</code> (Germany/German) in the source URL and also the <code>extraConfig</code> part. | |||
== Configuration == | == Configuration == | ||
=== Language === | |||
The default language of the Wordpress module will be English. It is possible to package additional languages and make them available for your specific instance. Using <code>extraConfig</code> you can configure the default language. In this example, we're going to package and enable the German language. | |||
=== Plugins and themes === | === Plugins and themes === | ||