Moodle
services.moodle.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/moodle.nix
services.moodle.database.host
Database host address.
Type: string
Default
"localhost"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.database.name
Database name.
Type: string
Default
"moodle"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.database.passwordFile
A file containing the password corresponding to
{option}database.user
.
Type: null or path
Default
null
Example
"/run/keys/moodle-dbpassword"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.database.type
Database engine to use.
Type: one of "mysql", "pgsql"
Default
"mysql"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.database.user
Database user.
Type: string
Default
"moodle"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.enable
Whether to enable Moodle web application.
Type: boolean
Default
false
Example
true
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.extraConfig
Any additional text to be appended to the config.php configuration file. This is a PHP script. For configuration details, see https://docs.moodle.org/37/en/Configuration_file.
Type: strings concatenated with "\n"
Default
""
Example
'' $CFG->disableupdatenotifications = true;''
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.initialPassword
Specifies the initial password for the admin, i.e. the password assigned if the user does not already exist. The password specified here is world-readable in the Nix store, so it should be changed promptly.
Type: string
Example
"correcthorsebatterystaple"
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.package
The moodle package to use.
Type: package
Default
pkgs.moodle
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.poolConfig
Options for the Moodle 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/moodle.nix
services.moodle.virtualHost
Apache configuration can be done by adapting {option}services.httpd.virtualHosts
.
See for further information.
Type: submodule
Example
{hostName = "moodle.example.org";adminAddr = "webmaster@example.org";forceSSL = true;enableACME = true;}
Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/services/web-apps/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix
services.moodle.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/moodle.nix