]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/emilia/production.nix
Refactor websites
[perso/Immae/Config/Nix.git] / modules / private / websites / emilia / production.nix
diff --git a/modules/private/websites/emilia/production.nix b/modules/private/websites/emilia/production.nix
deleted file mode 100644 (file)
index 71b97dd..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-{ lib, pkgs, config,  ... }:
-let
-    cfg = config.myServices.websites.emilia.production;
-    env = config.myEnv.websites.emilia;
-    varDir = "/var/lib/moodle";
-    siteDir = ./moodle;
-    webappName = "emilia_moodle";
-    root = "/run/current-system/webapps/${webappName}";
-    # php_admin_value[upload_max_filesize] = 50000000
-    # php_admin_value[post_max_size] = 50000000
-    configFile = ''
-      <?php  // Moodle configuration file
-
-      unset($CFG);
-      global $CFG;
-      $CFG = new stdClass();
-
-      $CFG->dbtype    = 'pgsql';
-      $CFG->dblibrary = 'native';
-      $CFG->dbhost    = '${env.postgresql.host}';
-      $CFG->dbname    = '${env.postgresql.database}';
-      $CFG->dbuser    = '${env.postgresql.user}';
-      $CFG->dbpass    = '${env.postgresql.password}';
-      $CFG->prefix    = 'mdl_';
-      $CFG->dboptions = array (
-        'dbpersist' => 0,
-        'dbport' => '${env.postgreesql.port}',
-        'dbsocket' => '${env.postgresql.password}',
-      );
-
-      $CFG->wwwroot   = 'https://www.saison-photo.org';
-      $CFG->dataroot  = '${varDir}';
-      $CFG->admin     = 'admin';
-
-      $CFG->directorypermissions = 02777;
-
-      require_once(__DIR__ . '/lib/setup.php');
-
-      // There is no php closing tag in this file,
-      // it is intentional because it prevents trailing whitespace problems!
-      '';
-in {
-  options.myServices.websites.emilia.production.enable = lib.mkEnableOption "enable Emilia's website";
-
-  config = lib.mkIf cfg.enable {
-    services.duplyBackup.profiles.emilia_prod = {
-      rootDir = varDir;
-    };
-    system.activationScripts.emilia = ''
-      install -m 0755 -o wwwrun -g wwwrun -d ${varDir}
-      '';
-    myServices.websites.webappDirs."${webappName}" = siteDir;
-    services.websites.env.production.vhostConfs.emilia = {
-      certName     = "emilia";
-      certMainHost = "saison-photo.org";
-      hosts        = [ "saison-photo.org" "www.saison-photo.org" ];
-      root         = root;
-      extraConfig  = [
-        ''
-        <Directory ${root}>
-          DirectoryIndex pause.html
-          Options Indexes FollowSymLinks MultiViews Includes
-          Require all granted
-        </Directory>
-          ''
-      ];
-    };
-  };
-}