]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/emilia/moodle.nix
Remove duply-backup
[perso/Immae/Config/Nix.git] / modules / private / websites / emilia / moodle.nix
CommitLineData
d3452fc5
IB
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.emilia.moodle;
4 env = config.myEnv.websites.emilia;
5 varDir = "/var/lib/emilia_moodle";
6 siteDir = ./moodle;
d3452fc5
IB
7 # php_admin_value[upload_max_filesize] = 50000000
8 # php_admin_value[post_max_size] = 50000000
9 configFile = ''
10 <?php // Moodle configuration file
11
12 unset($CFG);
13 global $CFG;
14 $CFG = new stdClass();
15
16 $CFG->dbtype = 'pgsql';
17 $CFG->dblibrary = 'native';
18 $CFG->dbhost = '${env.postgresql.host}';
19 $CFG->dbname = '${env.postgresql.database}';
20 $CFG->dbuser = '${env.postgresql.user}';
21 $CFG->dbpass = '${env.postgresql.password}';
22 $CFG->prefix = 'mdl_';
23 $CFG->dboptions = array (
24 'dbpersist' => 0,
25 'dbport' => '${env.postgreesql.port}',
26 'dbsocket' => '${env.postgresql.password}',
27 );
28
29 $CFG->wwwroot = 'https://www.saison-photo.org';
30 $CFG->dataroot = '${varDir}';
31 $CFG->admin = 'admin';
32
33 $CFG->directorypermissions = 02777;
34
35 require_once(__DIR__ . '/lib/setup.php');
36
37 // There is no php closing tag in this file,
38 // it is intentional because it prevents trailing whitespace problems!
39 '';
40 apacheUser = config.services.httpd.Prod.user;
41 apacheGroup = config.services.httpd.Prod.group;
42in {
43 options.myServices.websites.emilia.moodle.enable = lib.mkEnableOption "enable Emilia's website";
44
45 config = lib.mkIf cfg.enable {
d3452fc5
IB
46 system.activationScripts.emilia_moodle = ''
47 install -m 0755 -o ${apacheUser} -g ${apacheGroup} -d ${varDir}
48 '';
d3452fc5
IB
49 services.websites.env.production.vhostConfs.emilia_moodle = {
50 certName = "emilia";
51 certMainHost = "saison-photo.org";
52 hosts = [ "saison-photo.org" "www.saison-photo.org" ];
750fe5a4 53 root = siteDir;
d3452fc5
IB
54 extraConfig = [
55 ''
750fe5a4 56 <Directory ${siteDir}>
d3452fc5
IB
57 DirectoryIndex pause.html
58 Options Indexes FollowSymLinks MultiViews Includes
59 Require all granted
60 </Directory>
61 ''
62 ];
63 };
64 };
65}