]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/florian/app.nix
Add config for CI
[perso/Immae/Config/Nix.git] / modules / private / websites / florian / app.nix
index 14358d87972a9a95093a52e21a117e54e8de7a9d..2df344f84def0319601ac7e72c90d267e013dadd 100644 (file)
@@ -2,31 +2,26 @@
 let
   adminer = pkgs.callPackage ../commons/adminer.nix { inherit config; };
   secrets = config.myEnv.websites.tellesflorian.integration;
-  app = pkgs.callPackage ./app {
-    composerEnv = pkgs.composerEnv.override { php = pkgs.php72; };
-    environment = secrets.environment;
-    varDir = "/var/lib/florian_app";
-    secretsPath = config.secrets.fullPaths."websites/florian/app";
-  };
+  webRoot = "/var/lib/ftp/immae/florian/web";
   cfg = config.myServices.websites.florian.app;
   pcfg = config.services.phpApplication;
 in {
   options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration";
 
   config = lib.mkIf cfg.enable {
-    services.duplyBackup.profiles.florian_app.rootDir = app.varDir;
     services.phpApplication.apps.florian_app = {
       websiteEnv = "integration";
       httpdUser = config.services.httpd.Inte.user;
       httpdGroup = config.services.httpd.Inte.group;
-      inherit (app) webRoot varDir;
+      inherit webRoot;
+      varDir = "/var/lib/ftp/immae/florian_var";
       varDirPaths = {
         "var" = "0700";
       };
-      inherit app;
+      app = "/var/lib/ftp/immae/florian";
       serviceDeps = [ "mysql.service" ];
       preStartActions = [
-        "./bin/console --env=${app.environment} cache:clear --no-warmup"
+        "./bin/console --env=dev cache:clear --no-warmup"
       ];
       phpOpenbasedir = [ "/tmp" ];
       phpPool = {
@@ -46,18 +41,16 @@ in {
       phpPackage = pkgs.php72;
     };
 
-    secrets.keys = [
-      {
-        dest = "websites/florian/app_passwords";
+    secrets.keys = {
+      "websites/florian/app_passwords" = {
         user = config.services.httpd.Inte.user;
         group = config.services.httpd.Inte.group;
         permissions = "0400";
         text = ''
           invite:${secrets.invite_passwords}
         '';
-      }
-      {
-        dest = "websites/florian/app";
+      };
+      "websites/florian/app" = {
         user = config.services.httpd.Inte.user;
         group = config.services.httpd.Inte.group;
         permissions = "0400";
@@ -75,15 +68,15 @@ in {
             mailer_password: null
             secret: ${secrets.secret}
         '';
-      }
-    ];
+      };
+    };
 
     services.websites.env.integration.modules = adminer.apache.modules;
     services.websites.env.integration.vhostConfs.florian_app = {
       certName    = "integration";
       addToCerts  = true;
       hosts       = [ "app.tellesflorian.com" ];
-      root        = pcfg.webappDirs.florian_app;
+      root        = webRoot;
       extraConfig = [
         ''
         <FilesMatch "\.php$">
@@ -101,7 +94,7 @@ in {
           ErrorDocument 401 "<html><meta http-equiv=\"refresh\" content=\"0;url=https://tellesflorian.com\"></html>"
         </Location>
 
-        <Directory ${pcfg.webappDirs.florian_app}>
+        <Directory ${webRoot}>
           Options Indexes FollowSymLinks MultiViews Includes
           AllowOverride None
           Require all granted