Skip to content

Wordpress

services.wordpress.sites

Specification of one or more WordPress sites to serve Type: attribute set of (submodule)

Default

{ }

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.createLocally

Create the database and database user locally. Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.host

Database host address. Type: string

Default

"localhost"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.name

Database name. Type: string

Default

"wordpress"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.passwordFile

A file containing the password corresponding to {option}database.user.

Type: null or path

Default

null

Example

"/run/keys/wordpress-dbpassword"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.port

Database host port. Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default

3306

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.socket

Path to the unix socket file to use for authentication. Type: null or path

Default

/run/mysqld/mysqld.sock

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.tablePrefix

The $table_prefix is the value placed in the front of your database tables. Change the value if you want to use something other than wp_ for your database prefix. Typically this is changed if you are installing multiple WordPress blogs in the same database.

See https://codex.wordpress.org/Editing_wp-config.php#table_prefix.

Type: string

Default

"wp_"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.database.user

Database user. Type: string

Default

"wordpress"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.extraConfig

Any additional text to be appended to the wp-config.php configuration file. This is a PHP script. For configuration settings, see https://codex.wordpress.org/Editing_wp-config.php.

Note: Please pass structured settings via services.wordpress.sites.‹name›.settings instead.

Type: strings concatenated with "\n"

Default

""

Example

'' @ini_set( 'log_errors', 'Off' ); @ini_set( 'display_errors', 'On' );''

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.fontsDir

This directory is used to download fonts from a remote location, e.g. to host google fonts locally.

Type: path

Default

"/var/lib/wordpress/‹name›/fonts"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.languages

List of path(s) to respective language(s) which are copied from the 'languages' directory.

Type: list of path

Default

[ ]

Example

[# Let's package the German language.# For other languages try to replace language and country code in the download URL with your desired one.# Reference https://translate.wordpress.org for available translations and# codes.(pkgs.stdenv.mkDerivation {name = "language-de";src = pkgs.fetchurl {url = "https://de.wordpress.org/wordpress-${pkgs.wordpress.version}-de_DE.tar.gz";# Name is required to invalidate the hash when wordpress is updatedname = "wordpress-${pkgs.wordpress.version}-language-de";sha256 = "sha256-dlas0rXTSV4JAl8f/UyMbig57yURRYRhTMtJwF9g8h0=";};installPhase = "mkdir -p $out; cp -r ./wp-content/languages/* $out/";})];

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.mergedConfig

Read only representation of the final configuration.

Type: unspecified value

Default

{DISALLOW_FILE_EDIT = true;AUTOMATIC_UPDATER_DISABLED = true;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.package

The wordpress package to use. Type: package

Default

pkgs.wordpress

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.plugins

Path(s) to respective plugin(s) which are copied from the 'plugins' directory.

::: {.note} These plugins need to be packaged before use, see example. :::

Type: (attribute set of path) or (list of path) convertible to it

Default

{ }

Example

{inherit (pkgs.wordpressPackages.plugins) embed-pdf-viewer-plugin;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.poolConfig

Options for the WordPress PHP pool. See the documentation on php-fpm.conf for details on configuration directives.

Type: attribute set of (string or signed integer or boolean)

Default

{pm = "dynamic";"pm.max_children" = 32;"pm.max_requests" = 500;"pm.max_spare_servers" = 4;"pm.min_spare_servers" = 2;"pm.start_servers" = 2;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.settings

Structural Wordpress configuration. Refer to https://developer.wordpress.org/apis/wp-config-php for details and supported values.

Type: attribute set of anything

Default

{ }

Example

{WP_DEFAULT_THEME = "twentytwentytwo";WP_SITEURL = "https://example.org";WP_HOME = "https://example.org";WP_DEBUG = true;WP_DEBUG_DISPLAY = true;WPLANG = "de_DE";FORCE_SSL_ADMIN = true;AUTOMATIC_UPDATER_DISABLED = true;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.themes

Path(s) to respective theme(s) which are copied from the 'theme' directory.

::: {.note} These themes need to be packaged before use, see example. :::

Type: (attribute set of path) or (list of path) convertible to it

Default

{ inherit (pkgs.wordpressPackages.themes) twentytwentythree; }

Example

{inherit (pkgs.wordpressPackages.themes) responsive-theme;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.uploadsDir

This directory is used for uploads of pictures. The directory passed here is automatically created and permissions adjusted as required.

Type: path

Default

"/var/lib/wordpress/‹name›/uploads"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost

Apache configuration can be done by adapting {option}services.httpd.virtualHosts.

Type: submodule

Example

{adminAddr = "webmaster@example.org";forceSSL = true;enableACME = true;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.acmeRoot

Directory for the acme challenge which is PUBLIC, don't put certs or keys in here. Set to null to inherit from config.security.acme.

Type: null or string

Default

"/var/lib/acme/acme-challenge"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.addSSL

Whether to enable HTTPS in addition to plain HTTP. This will set defaults for listen to listen on all interfaces on the respective default ports (80, 443).

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.adminAddr

E-mail address of the server administrator. Type: null or string

Default

null

Example

"admin@example.org"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.documentRoot

The path of Apache's document root directory. If left undefined, an empty directory in the Nix store will be used as root.

Type: null or path

Default

null

Example

"/data/webserver/docs"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.enableACME

Whether to ask Let's Encrypt to sign a certificate for this vhost. Alternately, you can use an existing certificate through {option}useACMEHost.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.enableUserDir

Whether to enable serving {file}~/public_html as /~«username».

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.extraConfig

These lines go to httpd.conf verbatim. They will go after directories and directory aliases defined by default.

Type: strings concatenated with "\n"

Default

""

Example

'' <Directory /home> Options FollowSymlinks AllowOverride All </Directory>''

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.forceSSL

Whether to add a separate nginx server block that permanently redirects (301) all plain HTTP traffic to HTTPS. This will set defaults for listen to listen on all interfaces on the respective default ports (80, 443), where the non-SSL listens are used for the redirect vhosts.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.globalRedirect

If set, all requests for this host are redirected permanently to the given URL.

Type: null or string

Default

null

Example

"http://newserver.example.org/"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.hostName

Canonical hostname for the server. Type: string

Default

"‹name›"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.http2

Whether to enable HTTP 2. HTTP/2 is supported in all multi-processing modules that come with httpd. However, if you use the prefork mpm, there will be severe restrictions. Refer to https://httpd.apache.org/docs/2.4/howto/http2.html#mpm-config for details.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.listen

Listen addresses and ports for this virtual host.

::: {.note} This option overrides addSSL, forceSSL and onlySSL.

If you only want to set the addresses manually and not the ports, take a look at listenAddresses. :::

Type: list of (submodule)

Default

[ ]

Example

[{ip = "195.154.1.1";port = 443;ssl = true;}{ip = "192.154.1.1";port = 80;}{ip = "*";port = 8080;}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.listen.*.ip

IP to listen on. 0.0.0.0 for IPv4 only, * for all. Type: string

Default

"*"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.listen.*.port

Port to listen on Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.listen.*.ssl

Whether to enable SSL (https) support. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.listenAddresses

Listen addresses for this virtual host. Compared to listen this only sets the addresses and the ports are chosen automatically.

Type: non-empty (list of string)

Default

["*"]

Example

["127.0.0.1"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations

Declarative location config. See https://httpd.apache.org/docs/2.4/mod/core.html#location for details.

Type: attribute set of (submodule)

Default

{ }

Example

{"/" = {proxyPass = "http://localhost:3000";};"/foo/bar.png" = {alias = "/home/eelco/some-file.png";};};

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations.<name>.alias

Alias directory for requests. See https://httpd.apache.org/docs/2.4/mod/mod_alias.html#alias.

Type: null or path

Default

null

Example

"/your/alias/directory"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations.<name>.extraConfig

These lines go to the end of the location verbatim.

Type: strings concatenated with "\n"

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations.<name>.index

Adds DirectoryIndex directive. See https://httpd.apache.org/docs/2.4/mod/mod_dir.html#directoryindex.

Type: null or string

Default

null

Example

"index.php index.html"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations.<name>.priority

Order of this location block in relation to the others in the vhost. The semantics are the same as with lib.mkOrder. Smaller values have a greater priority.

Type: signed integer

Default

1000

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.locations.<name>.proxyPass

Sets up a simple reverse proxy as described by https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html#simple.

Type: null or string

Default

null

Example

"http://www.example.org/"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.logFormat

Log format for Apache's log files. Possible values are: combined, common, referer, agent.

Type: string

Default

"common"

Example

"combined"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.onlySSL

Whether to enable HTTPS and reject plain HTTP connections. This will set defaults for listen to listen on all interfaces on port 443.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.robotsEntries

Specification of pages to be ignored by web crawlers. See http://www.robotstxt.org/ for details.

Type: strings concatenated with "\n"

Default

""

Example

"Disallow: /foo/"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.servedDirs

This option provides a simple way to serve static directories.

Type: list of (attribute set)

Default

[ ]

Example

[{dir = "/home/eelco/Dev/nix-homepage";urlPath = "/nix";}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.servedFiles

This option provides a simple way to serve individual, static files.

::: {.note} This option has been deprecated and will be removed in a future version of NixOS. You can achieve the same result by making use of the locations.<name>.alias option. :::

Type: list of (attribute set)

Default

[ ]

Example

[{file = "/home/eelco/some-file.png";urlPath = "/foo/bar.png";}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.serverAliases

Additional names of virtual hosts served by this virtual host configuration.

Type: list of string

Default

[ ]

Example

["www.example.org""www.example.org:8080""example.org"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.sslServerCert

Path to server SSL certificate. Type: path

Example

"/var/host.cert"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.sslServerChain

Path to server SSL chain file. Type: null or path

Default

null

Example

"/var/ca.pem"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.sslServerKey

Path to server SSL certificate key. Type: path

Example

"/var/host.key"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.sites.<name>.virtualHost.useACMEHost

A host of an existing Let's Encrypt certificate to use. This is useful if you have many subdomains and want to avoid hitting the rate limit. Alternately, you can generate a certificate through {option}enableACME. Note that this option does not create any certificates, nor it does add subdomains to existing ones – you will need to create them manually using .

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix

services.wordpress.webserver

Whether to use apache2 or nginx for virtual host management.

Further nginx configuration can be done by adapting services.nginx.virtualHosts.<name>. See for further information.

Further apache2 configuration can be done by adapting services.httpd.virtualHosts.<name>. See for further information.

Type: one of "httpd", "nginx", "caddy"

Default

"httpd"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/wordpress.nix