1 { lib, pkgs, config, myconfig, mylibs, ... }:
3 cfg = config.services.myWebsites.Emilia;
4 env = myconfig.env.websites.emilia;
5 varDir = "/var/lib/moodle";
7 webappName = "emilia_moodle";
8 root = "/run/current-system/webapps/${webappName}";
9 # php_admin_value[upload_max_filesize] = 50000000
10 # php_admin_value[post_max_size] = 50000000
12 <?php // Moodle configuration file
16 $CFG = new stdClass();
18 $CFG->dbtype = 'pgsql';
19 $CFG->dblibrary = 'native';
20 $CFG->dbhost = '${env.postgresql.host}';
21 $CFG->dbname = '${env.postgresql.database}';
22 $CFG->dbuser = '${env.postgresql.user}';
23 $CFG->dbpass = '${env.postgresql.password}';
24 $CFG->prefix = 'mdl_';
25 $CFG->dboptions = array (
27 'dbport' => '${env.postgreesql.port}',
28 'dbsocket' => '${env.postgresql.password}',
31 $CFG->wwwroot = 'https://www.saison-photo.org';
32 $CFG->dataroot = '${varDir}';
33 $CFG->admin = 'admin';
35 $CFG->directorypermissions = 02777;
37 require_once(__DIR__ . '/lib/setup.php');
39 // There is no php closing tag in this file,
40 // it is intentional because it prevents trailing whitespace problems!
43 options.services.myWebsites.Emilia = {
45 enable = lib.mkEnableOption "enable Emilia's website";
49 config = lib.mkIf cfg.production.enable {
50 security.acme.certs."emilia" = config.services.myCertificates.certConfig // {
51 domain = "saison-photo.org";
53 "www.saison-photo.org" = null;
57 system.activationScripts.emilia = ''
58 install -m 0755 -o wwwrun -g wwwrun -d ${varDir}
60 system.extraSystemBuilderCmds = ''
62 ln -s ${siteDir} $out/webapps/${webappName}
64 services.myWebsites.production.vhostConfs.emilia = {
66 hosts = [ "saison-photo.org" "www.saison-photo.org" ];
71 DirectoryIndex pause.html
72 Options Indexes FollowSymLinks MultiViews Includes