]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Purify connexionswing website
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 23 Jan 2019 11:05:28 +0000 (12:05 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 23 Jan 2019 11:06:29 +0000 (12:06 +0100)
virtual/modules/websites/commons/composer-env.nix [new file with mode: 0644]
virtual/modules/websites/connexionswing/connexionswing.json
virtual/modules/websites/connexionswing/connexionswing.nix
virtual/modules/websites/connexionswing/php-packages.nix [new file with mode: 0644]
virtual/modules/websites/default.nix

diff --git a/virtual/modules/websites/commons/composer-env.nix b/virtual/modules/websites/commons/composer-env.nix
new file mode 100644 (file)
index 0000000..123d5fa
--- /dev/null
@@ -0,0 +1,274 @@
+# This file originates from composer2nix
+
+{ stdenv, writeTextFile, fetchurl, php, unzip }:
+
+let
+  composer = stdenv.mkDerivation {
+    name = "composer-1.8.0";
+    src = fetchurl {
+      url = https://github.com/composer/composer/releases/download/1.8.0/composer.phar;
+      sha256 = "19pg9ip2mpyf5cyq34fld7qwl77mshqw3c4nif7sxmpnar6sh089";
+    };
+    buildInputs = [ php ];
+
+    # We must wrap the composer.phar because of the impure shebang.
+    # We cannot use patchShebangs because the executable verifies its own integrity and will detect that somebody has tampered with it.
+
+    buildCommand = ''
+      # Copy phar file
+      mkdir -p $out/share/php
+      cp $src $out/share/php/composer.phar
+      chmod 755 $out/share/php/composer.phar
+
+      # Create wrapper executable
+      mkdir -p $out/bin
+      cat > $out/bin/composer <<EOF
+      #! ${stdenv.shell} -e
+      exec ${php}/bin/php $out/share/php/composer.phar "\$@"
+      EOF
+      chmod +x $out/bin/composer
+    '';
+    meta = {
+      description = "Dependency Manager for PHP";
+      #license = stdenv.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.sander ];
+      platforms = stdenv.lib.platforms.unix;
+    };
+  };
+
+  buildZipPackage = { name, src }:
+    stdenv.mkDerivation {
+      inherit name src;
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        unzip $src
+        baseDir=$(find . -type d -mindepth 1 -maxdepth 1)
+        cd $baseDir
+        mkdir -p $out
+        mv * $out
+      '';
+    };
+
+  buildPackage =
+    { name
+    , src
+    , packages ? {}
+    , devPackages ? {}
+    , buildInputs ? []
+    , symlinkDependencies ? false
+    , executable ? false
+    , removeComposerArtifacts ? false
+    , postInstall ? ""
+    , preInstall ? ""
+    , noDev ? false
+    , unpackPhase ? "true"
+    , buildPhase ? "true"
+    , ...}@args:
+
+    let
+      reconstructInstalled = writeTextFile {
+        name = "reconstructinstalled.php";
+        executable = true;
+        text = ''
+          #! ${php}/bin/php
+          <?php
+          if(file_exists($argv[1]))
+          {
+              $composerLockStr = file_get_contents($argv[1]);
+
+              if($composerLockStr === false)
+              {
+                  fwrite(STDERR, "Cannot open composer.lock contents\n");
+                  exit(1);
+              }
+              else
+              {
+                  $config = json_decode($composerLockStr, true);
+
+                  if(array_key_exists("packages", $config))
+                      $allPackages = $config["packages"];
+                  else
+                      $allPackages = array();
+
+                  ${stdenv.lib.optionalString (!noDev) ''
+                    if(array_key_exists("packages-dev", $config))
+                        $allPackages = array_merge($allPackages, $config["packages-dev"]);
+                  ''}
+
+                  $packagesStr = json_encode($allPackages, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
+                  print($packagesStr);
+              }
+          }
+          else
+              print("[]");
+          ?>
+        '';
+      };
+
+      constructBin = writeTextFile {
+        name = "constructbin.php";
+        executable = true;
+        text = ''
+          #! ${php}/bin/php
+          <?php
+          $composerJSONStr = file_get_contents($argv[1]);
+
+          if($composerJSONStr === false)
+          {
+              fwrite(STDERR, "Cannot open composer.json contents\n");
+              exit(1);
+          }
+          else
+          {
+              $config = json_decode($composerJSONStr, true);
+
+              if(array_key_exists("bin-dir", $config))
+                  $binDir = $config["bin-dir"];
+              else
+                  $binDir = "bin";
+
+              if(array_key_exists("bin", $config))
+              {
+                  if(!file_exists("vendor/".$binDir))
+                      mkdir("vendor/".$binDir);
+
+                  foreach($config["bin"] as $bin)
+                      symlink("../../".$bin, "vendor/".$binDir."/".basename($bin));
+              }
+          }
+          ?>
+        '';
+      };
+
+      bundleDependencies = dependencies:
+        stdenv.lib.concatMapStrings (dependencyName:
+          let
+            dependency = dependencies.${dependencyName};
+          in
+          ''
+            ${if dependency.targetDir == "" then ''
+              vendorDir="$(dirname ${dependencyName})"
+              mkdir -p "$vendorDir"
+              ${if symlinkDependencies then
+                ''ln -s "${dependency.src}" "$vendorDir/$(basename "${dependencyName}")"''
+                else
+                ''cp -av "${dependency.src}" "$vendorDir/$(basename "${dependencyName}")"''
+              }
+            '' else ''
+              namespaceDir="${dependencyName}/$(dirname "${dependency.targetDir}")"
+              mkdir -p "$namespaceDir"
+              ${if symlinkDependencies then
+                ''ln -s "${dependency.src}" "$namespaceDir/$(basename "${dependency.targetDir}")"''
+              else
+                ''cp -av "${dependency.src}" "$namespaceDir/$(basename "${dependency.targetDir}")"''
+              }
+            ''}
+          '') (builtins.attrNames dependencies);
+
+      extraArgs = removeAttrs args [ "name" "packages" "devPackages" "buildInputs" ];
+    in
+    stdenv.mkDerivation ({
+      name = "composer-${name}";
+      buildInputs = [ php composer ] ++ buildInputs;
+
+      inherit unpackPhase buildPhase;
+
+      installPhase = ''
+        ${if executable then ''
+          mkdir -p $out/share/php
+          cp -av $src $out/share/php/$name
+          chmod -R u+w $out/share/php/$name
+          cd $out/share/php/$name
+        '' else ''
+          cp -av $src $out
+          chmod -R u+w $out
+          cd $out
+        ''}
+
+        # Execute pre install hook
+        runHook preInstall
+
+        # Remove unwanted files
+        rm -f *.nix
+
+        export HOME=$TMPDIR
+
+        # Remove the provided vendor folder if it exists
+        rm -Rf vendor
+
+        # If there is no composer.lock file, compose a dummy file.
+        # Otherwise, composer attempts to download the package.json file from
+        # the registry which we do not want.
+        if [ ! -f composer.lock ]
+        then
+            cat > composer.lock <<EOF
+        {
+            "packages": []
+        }
+        EOF
+        fi
+
+        # Reconstruct the installed.json file from the lock file
+        mkdir -p vendor/composer
+        ${reconstructInstalled} composer.lock > vendor/composer/installed.json
+
+        # Copy or symlink the provided dependencies
+        cd vendor
+        ${bundleDependencies packages}
+        ${stdenv.lib.optionalString (!noDev) (bundleDependencies devPackages)}
+        cd ..
+
+        # Reconstruct autoload scripts
+        # We use the optimize feature because Nix packages cannot change after they have been built
+        # Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload.
+        composer dump-autoload --optimize ${stdenv.lib.optionalString noDev "--no-dev"}
+
+        # Run the install step as a validation to confirm that everything works out as expected
+        composer install --optimize-autoloader ${stdenv.lib.optionalString noDev "--no-dev"}
+
+        ${stdenv.lib.optionalString executable ''
+          # Reconstruct the bin/ folder if we deploy an executable project
+          ${constructBin} composer.json
+          ln -s $(pwd)/vendor/bin $out/bin
+        ''}
+
+        ${stdenv.lib.optionalString (!symlinkDependencies) ''
+          # Patch the shebangs if possible
+          if [ -d $(pwd)/vendor/bin ]
+          then
+              # Look for all executables in bin/
+              for i in $(pwd)/vendor/bin/*
+              do
+                  # Look for their location
+                  realFile=$(readlink -f "$i")
+
+                  # Restore write permissions
+                  chmod u+wx "$(dirname "$realFile")"
+                  chmod u+w "$realFile"
+
+                  # Patch shebang
+                  sed -e "s|#!/usr/bin/php|#!${php}/bin/php|" \
+                      -e "s|#!/usr/bin/env php|#!${php}/bin/php|" \
+                      "$realFile" > tmp
+                  mv tmp "$realFile"
+                  chmod u+x "$realFile"
+              done
+          fi
+        ''}
+
+        if [ "$removeComposerArtifacts" = "1" ]
+        then
+            # Remove composer stuff
+            rm -f composer.json composer.lock
+        fi
+
+        # Execute post install hook
+        runHook postInstall
+    '';
+  } // extraArgs);
+in
+{
+  composer = stdenv.lib.makeOverridable composer;
+  buildZipPackage = stdenv.lib.makeOverridable buildZipPackage;
+  buildPackage = stdenv.lib.makeOverridable buildPackage;
+}
index 146c5f6e4483c8ee37510ea34bb8788913c8843d..44d9f0e40f50f6a7b08319ba8afc0031c1333ede 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "tag": "0330478-master",
+  "tag": "dfcdce0-master",
   "meta": {
     "name": "connexionswing",
     "url": "gitolite@git.immae.eu:perso/Immae/Projets/Connexionswing",
@@ -7,8 +7,8 @@
   },
   "git": {
     "url": "gitolite@git.immae.eu:perso/Immae/Projets/Connexionswing",
-    "rev": "0330478cd256e6e36f525d3d0a247bad06de319f",
-    "sha256": "1sh97965winvbmpzqhjidhqry9840fa701wvr4vxywccyg4dyr17",
+    "rev": "dfcdce04d11a75f5e850e6dc3a049de4517fc107",
+    "sha256": "0ddirwxs2ify3bni6nv787nb31ckyn2hsrcq8g01b5cfv5havkwq",
     "fetchSubmodules": true
   }
 }
index 66c9b53673e1a4df8d7119ae3cccc72d59a619a8..ecbbfd56b1304eb7bd30b902ab6c861a9cd26a8c 100644 (file)
@@ -1,9 +1,8 @@
-{ lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert }:
+{ pkgs, lib, writeText, fetchedGitPrivate, stdenv, composerEnv, fetchurl, fetchgit }:
 let
   connexionswing = { config }: rec {
     environment = config.environment;
     varDir = "/var/lib/connexionswing_${environment}";
-    envName= lib.strings.toUpper environment;
     configRoot =
       writeText "parameters.yml" ''
         # This file is auto-generated during the composer install
@@ -13,6 +12,7 @@ let
             database_name: ${config.mysql.name}
             database_user: ${config.mysql.user}
             database_password: ${config.mysql.password}
+            database_server_version: ${pkgs.mariadb.mysqlVersion}
             mailer_transport: smtp
             mailer_host: mail.immae.eu
             mailer_user: null
@@ -143,28 +143,24 @@ let
       fi
       '';
     };
-    webappDir = stdenv.mkDerivation (fetchedGitPrivate ./connexionswing.json // rec {
-      buildPhase = ''
-        export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
-        export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
-
-        ln -sf ../../../../../${varDir}/{medias,uploads} web/images/
-        ln -sf ${configRoot} app/config/parameters.yml
-        sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json
-        ${if environment == "dev" then "php bin/composer install" else ''
-        SYMFONY_ENV=prod php bin/composer install --no-dev
-        ./bin/console assetic:dump --env=prod --no-debug
-        ''}
-        rm -rf var
-        ln -sf ../../../../../${varDir}/var var
-        '';
-      installPhase = ''
-        cp -a . $out
-        '';
-      buildInputs = [
-        php git cacert
-      ];
-    });
+    webappDir = composerEnv.buildPackage (
+      import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
+      fetchedGitPrivate ./connexionswing.json //
+      rec {
+        noDev = (environment == "prod");
+        preInstall = ''
+          export SYMFONY_ENV="${environment}"
+          '';
+        postInstall = ''
+          cd $out
+          ${if environment == "prod" then "php ./bin/console assetic:dump --env=prod --no-debug" else ""}
+          rm app/config/parameters.yml
+          ln -sf ${configRoot} app/config/parameters.yml
+          rm -rf var/{logs,cache}
+          ln -sf ../../../../../../${varDir}/var/{logs,cache} var/
+          ln -sf ../../../../../${varDir}/{medias,uploads} web/images/
+          '';
+      });
     webRoot = "${webappDir}/web";
   };
 in
diff --git a/virtual/modules/websites/connexionswing/php-packages.nix b/virtual/modules/websites/connexionswing/php-packages.nix
new file mode 100644 (file)
index 0000000..581b437
--- /dev/null
@@ -0,0 +1,597 @@
+# Generated with composer2nix and adapted to return only the list of
+# packages
+{ composerEnv, fetchurl, fetchgit ? null }:
+{
+  packages = {
+    "behat/transliterator" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "behat-transliterator-826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c";
+        src = fetchurl {
+          url = https://api.github.com/repos/Behat/Transliterator/zipball/826ce7e9c2a6664c0d1f381cbb38b1fb80a7ee2c;
+          sha256 = "1mgc9azx79fkrxahji3xwbgqhlcnvh3xk6llqdvhjb7vgzj4bqq0";
+        };
+      };
+    };
+    "components/bootstrap" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "components-bootstrap-670295b9d6170a79acc8586a15e729bf24128275";
+        src = fetchurl {
+          url = https://api.github.com/repos/components/bootstrap/zipball/670295b9d6170a79acc8586a15e729bf24128275;
+          sha256 = "0lcq9cjnywvf1nd8k99flgcf2dmfgyyxzsvcpip8xiibmh5x04p9";
+        };
+      };
+    };
+    "components/jquery" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "components-jquery-5dd7297d7603e11e53bdcca2a71074d92de37b8f";
+        src = fetchurl {
+          url = https://api.github.com/repos/components/jquery/zipball/5dd7297d7603e11e53bdcca2a71074d92de37b8f;
+          sha256 = "1maplw3yic1pzbwwl2amjlivipsi1w0r8bq7i0mmjaqf7wij506i";
+        };
+      };
+    };
+    "components/jqueryui" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "components-jqueryui-44ecf3794cc56b65954cc19737234a3119d036cc";
+        src = fetchurl {
+          url = https://api.github.com/repos/components/jqueryui/zipball/44ecf3794cc56b65954cc19737234a3119d036cc;
+          sha256 = "1y0ppxk44jkxbh38i05sg0zcgk927s5wy6sjngwr5qifibqbcbhk";
+        };
+      };
+    };
+    "composer/ca-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "composer-ca-bundle-d2c0a83b7533d6912e8d516756ebd34f893e9169";
+        src = fetchurl {
+          url = https://api.github.com/repos/composer/ca-bundle/zipball/d2c0a83b7533d6912e8d516756ebd34f893e9169;
+          sha256 = "1as399dzrfbjnifb87j1g5cvrbacyddbay8fv59i56xx1bdq7lwc";
+        };
+      };
+    };
+    "doctrine/annotations" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-annotations-54cacc9b81758b14e3ce750f205a393d52339e97";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97;
+          sha256 = "1wi5skihqbcinlkrkr15nmmvqkn2gydqib8xl232abdvfq1q0w24";
+        };
+      };
+    };
+    "doctrine/cache" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-cache-eb152c5100571c7a45470ff2a35095ab3f3b900b";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b;
+          sha256 = "0iq0qqv1smlqz63jhj2fpjy54c5dwfwxyf5c89iky6i0yb81gwyd";
+        };
+      };
+    };
+    "doctrine/collections" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-collections-1a4fb7e902202c33cce8c55989b945612943c2ba";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba;
+          sha256 = "0fkiwkx7zbmfnh4p21za807lh1n7g1f4lpgy8y59g4r5krvpl90w";
+        };
+      };
+    };
+    "doctrine/common" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-common-4acb8f89626baafede6ee5475bc5844096eba8a9";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/common/zipball/4acb8f89626baafede6ee5475bc5844096eba8a9;
+          sha256 = "0qjqframvg81z3lwqaj5haanqj9v3dfbj170pxmwlgmrfsbr16zh";
+        };
+      };
+    };
+    "doctrine/dbal" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-dbal-729340d8d1eec8f01bff708e12e449a3415af873";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/dbal/zipball/729340d8d1eec8f01bff708e12e449a3415af873;
+          sha256 = "184p8h0n6mcm0y6vfyh0z6qcxmmf8h5z4vdvxd4ycmx0531lnhj3";
+        };
+      };
+    };
+    "doctrine/doctrine-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-doctrine-bundle-703fad32e4c8cbe609caf45a71a1d4266c830f0f";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/DoctrineBundle/zipball/703fad32e4c8cbe609caf45a71a1d4266c830f0f;
+          sha256 = "0v2f63j22i3im8jbmv7spi8j42fay6dnxjvbxnbwj190ajxl6sdp";
+        };
+      };
+    };
+    "doctrine/doctrine-cache-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-doctrine-cache-bundle-4c8e363f96427924e7e519c5b5119b4f54512697";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/DoctrineCacheBundle/zipball/4c8e363f96427924e7e519c5b5119b4f54512697;
+          sha256 = "1irm04iijzq6gziknwyb10a9s0xbzh04xs5i2d6aac86cc29187c";
+        };
+      };
+    };
+    "doctrine/doctrine-migrations-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-doctrine-migrations-bundle-a9e506369f931351a2a6dd2aef588a822802b1b7";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/DoctrineMigrationsBundle/zipball/a9e506369f931351a2a6dd2aef588a822802b1b7;
+          sha256 = "1jgrqsgdwcm2g8rml76qr6b19s1vxfbnrp43qr6n1g9kbx7y9wg9";
+        };
+      };
+    };
+    "doctrine/inflector" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-inflector-90b2128806bfde671b6952ab8bea493942c1fdae";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae;
+          sha256 = "01vmclj3k7xil51jg329fznshh8d07pvm4mr89lvfn1d7fyrq6qw";
+        };
+      };
+    };
+    "doctrine/instantiator" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-instantiator-8e884e78f9f0eb1329e445619e04456e64d8051d";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d;
+          sha256 = "15dcja45rnwya431pcm826l68k1g8f1fabl7rih69alcdyvdlln4";
+        };
+      };
+    };
+    "doctrine/lexer" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-lexer-83893c552fd2045dd78aef794c31e694c37c0b8c";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c;
+          sha256 = "0cyh3vwcl163cx1vrcwmhlh5jg9h47xwiqgzc6rwscxw0ppd1v74";
+        };
+      };
+    };
+    "doctrine/migrations" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-migrations-c81147c0f2938a6566594455367e095150547f72";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/migrations/zipball/c81147c0f2938a6566594455367e095150547f72;
+          sha256 = "0x8hvxbm3f40sx25nq8zlh1kr936pagghzp89l0gdy5bar7cdzi5";
+        };
+      };
+    };
+    "doctrine/orm" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-orm-810a7baf81462a5ddf10e8baa8cb94b6eec02754";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/doctrine2/zipball/810a7baf81462a5ddf10e8baa8cb94b6eec02754;
+          sha256 = "1hmkc7917kgnav9hmlgvlp7qwm3zjj910ci71g9yqwjh6s28wrf1";
+        };
+      };
+    };
+    "fig/link-util" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "fig-link-util-1a07821801a148be4add11ab0603e4af55a72fac";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/link-util/zipball/1a07821801a148be4add11ab0603e4af55a72fac;
+          sha256 = "0ky1pq4a17br5zvcychjghgwr6wpkgp409hdv0ljdk3ks90w5w64";
+        };
+      };
+    };
+    "friendsofsymfony/jsrouting-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "friendsofsymfony-jsrouting-bundle-49c1069132dcef371fb526351569deabeb6f0d8e";
+        src = fetchurl {
+          url = https://api.github.com/repos/FriendsOfSymfony/FOSJsRoutingBundle/zipball/49c1069132dcef371fb526351569deabeb6f0d8e;
+          sha256 = "0ymmxhxbjnzj8bk3zq55vq0xvsaq82348v321gy2jyi90d19p5j7";
+        };
+      };
+    };
+    "gedmo/doctrine-extensions" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "gedmo-doctrine-extensions-1e400fbd05b7e5f912f55fe95805450f7d3bed60";
+        src = fetchurl {
+          url = https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/1e400fbd05b7e5f912f55fe95805450f7d3bed60;
+          sha256 = "0mpdpmar1hxamz2x2iqjickf1msjh67kkfpsblnklxk5izjwzhxx";
+        };
+      };
+    };
+    "immae/connexionswing-ckeditor-component" = {
+      targetDir = "";
+      src = fetchgit {
+        name = "immae-connexionswing-ckeditor-component-3b35bd273a79f6b01fda7a246aed64aca147ea7a";
+        url = "https://git.immae.eu/perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git";
+        rev = "3b35bd273a79f6b01fda7a246aed64aca147ea7a";
+        sha256 = "1w0y6k28ci73n0db9gwvqg7grzvh1z718ys9v1ik8cla7zw83bni";
+      };
+    };
+    "immae/jquery-touchswipe" = {
+      targetDir = "";
+      src = fetchgit {
+        name = "immae-jquery-touchswipe-3e15949df974d6612d76dc9ee75cd976dbcc2114";
+        url = "https://git.immae.eu/perso/Immae/Projets/packagist/jquery-touchswipe.git";
+        rev = "3e15949df974d6612d76dc9ee75cd976dbcc2114";
+        sha256 = "1pnvki1j3a65cdwwqs0id790ni813lh3r0m7556gdn0hsqa1cc4d";
+      };
+    };
+    "incenteev/composer-parameter-handler" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "incenteev-composer-parameter-handler-933c45a34814f27f2345c11c37d46b3ca7303550";
+        src = fetchurl {
+          url = https://api.github.com/repos/Incenteev/ParameterHandler/zipball/933c45a34814f27f2345c11c37d46b3ca7303550;
+          sha256 = "1zqdwlcl790kjyz4rkpva35xkfsp8kslds82fzznj0yigkgnbifm";
+        };
+      };
+    };
+    "jdorn/sql-formatter" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "jdorn-sql-formatter-64990d96e0959dff8e059dfcdc1af130728d92bc";
+        src = fetchurl {
+          url = https://api.github.com/repos/jdorn/sql-formatter/zipball/64990d96e0959dff8e059dfcdc1af130728d92bc;
+          sha256 = "1dnmkm8mxylvxjwi0bdkzrlklncqx92fa4fwqp5bh2ypj8gaagzi";
+        };
+      };
+    };
+    "kriswallsmith/assetic" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "kriswallsmith-assetic-e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1";
+        src = fetchurl {
+          url = https://api.github.com/repos/kriswallsmith/assetic/zipball/e911c437dbdf006a8f62c2f59b15b2d69a5e0aa1;
+          sha256 = "1dqk4zvx8fgqf8rb81sj9bipl5431jib2b9kcvxyig5fw99irpf8";
+        };
+      };
+    };
+    "monolog/monolog" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "monolog-monolog-fd8c787753b3a2ad11bc60c063cff1358a32a3b4";
+        src = fetchurl {
+          url = https://api.github.com/repos/Seldaek/monolog/zipball/fd8c787753b3a2ad11bc60c063cff1358a32a3b4;
+          sha256 = "0avf3y8raw23krwdb7kw9qb5bsr5ls4i7qd2vh7hcds3qjixg3h9";
+        };
+      };
+    };
+    "ocramius/proxy-manager" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "ocramius-proxy-manager-57e9272ec0e8deccf09421596e0e2252df440e11";
+        src = fetchurl {
+          url = https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11;
+          sha256 = "10crhcnhz42b01i6lv6ysgc7awp7yw82p4i2a4sg6bjihw677yps";
+        };
+      };
+    };
+    "paragonie/random_compat" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "paragonie-random_compat-258c89a6b97de7dfaf5b8c7607d0478e236b04fb";
+        src = fetchurl {
+          url = https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb;
+          sha256 = "11arrici2mgfj7r847wm423pqrvfj9wn9jcgyxnq4rzyahaxz5l1";
+        };
+      };
+    };
+    "psr/cache" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "psr-cache-d11b50ad223250cf17b86e38383413f5a6764bf8";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8;
+          sha256 = "06i2k3dx3b4lgn9a4v1dlgv8l9wcl4kl7vzhh63lbji0q96hv8qz";
+        };
+      };
+    };
+    "psr/container" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "psr-container-b7ce3b176482dbbc1245ebf52b181af44c2cf55f";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f;
+          sha256 = "0rkz64vgwb0gfi09klvgay4qnw993l1dc03vyip7d7m2zxi6cy4j";
+        };
+      };
+    };
+    "psr/link" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "psr-link-eea8e8662d5cd3ae4517c9b864493f59fca95562";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/link/zipball/eea8e8662d5cd3ae4517c9b864493f59fca95562;
+          sha256 = "091k4p9irkqnmq9b0p792wz1hb7dm4rafpjilw9im9xhsxgkmr13";
+        };
+      };
+    };
+    "psr/log" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "psr-log-4ebe3a8bf773a19edfe0a84b6585ba3d401b724d";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d;
+          sha256 = "1mlcv17fjw39bjpck176ah1z393b6pnbw3jqhhrblj27c70785md";
+        };
+      };
+    };
+    "psr/simple-cache" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "psr-simple-cache-408d5eafb83c57f6365a3ca330ff23aa4a5fa39b";
+        src = fetchurl {
+          url = https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b;
+          sha256 = "1djgzclkamjxi9jy4m9ggfzgq1vqxaga2ip7l3cj88p7rwkzjxgw";
+        };
+      };
+    };
+    "ricbra/robots-txt-bundle" = {
+      targetDir = "Ricbra/Bundle/RobotsTxtBundle";
+      src = composerEnv.buildZipPackage {
+        name = "ricbra-robots-txt-bundle-80d122a708893a762041464890e59a76babd6c22";
+        src = fetchurl {
+          url = https://api.github.com/repos/ricbra/robots-txt-bundle/zipball/80d122a708893a762041464890e59a76babd6c22;
+          sha256 = "0w3lfzy1ys0bwl3shy4ychldfd711w1p2y13i1az2z2gh731d0ad";
+        };
+      };
+    };
+    "robloach/component-installer" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "robloach-component-installer-908a859aa7c4949ba9ad67091e67bac10b66d3d7";
+        src = fetchurl {
+          url = https://api.github.com/repos/RobLoach/component-installer/zipball/908a859aa7c4949ba9ad67091e67bac10b66d3d7;
+          sha256 = "19y5sv4k338bihzmm8iac6q43r18vxhmbpvrdhz8jn39r51ampq9";
+        };
+      };
+    };
+    "sensio/distribution-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "sensio-distribution-bundle-eb6266b3b472e4002538610b28a0a04bcf94891a";
+        src = fetchurl {
+          url = https://api.github.com/repos/sensiolabs/SensioDistributionBundle/zipball/eb6266b3b472e4002538610b28a0a04bcf94891a;
+          sha256 = "0wyffqj924lz9cv0vbahyngjw1g850v0p34swygzzgp3cr0ank13";
+        };
+      };
+    };
+    "sensio/framework-extra-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "sensio-framework-extra-bundle-bb907234df776b68922eb4b25bfa061683597b6a";
+        src = fetchurl {
+          url = https://api.github.com/repos/sensiolabs/SensioFrameworkExtraBundle/zipball/bb907234df776b68922eb4b25bfa061683597b6a;
+          sha256 = "011hcljjcfq5qy4a7mlf0hwqxyb58yci40ini0n5rqandcyk2nck";
+        };
+      };
+    };
+    "sensiolabs/security-checker" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "sensiolabs-security-checker-dc270d5fec418cc6ac983671dba5d80ffaffb142";
+        src = fetchurl {
+          url = https://api.github.com/repos/sensiolabs/security-checker/zipball/dc270d5fec418cc6ac983671dba5d80ffaffb142;
+          sha256 = "0fnshyd6f8j91a7y604nh6sqgscjl48mfa0727g2r4hkdfz8hpd1";
+        };
+      };
+    };
+    "swiftmailer/swiftmailer" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "swiftmailer-swiftmailer-7ffc1ea296ed14bf8260b6ef11b80208dbadba91";
+        src = fetchurl {
+          url = https://api.github.com/repos/swiftmailer/swiftmailer/zipball/7ffc1ea296ed14bf8260b6ef11b80208dbadba91;
+          sha256 = "1vl5pzgvr2yfrj1yfs02mi917b0gr56v76ibi40r51a3346zhp6v";
+        };
+      };
+    };
+    "symfony/assetic-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-assetic-bundle-2e0a23a4874838e26de6f025e02fc63328921a4c";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/assetic-bundle/zipball/2e0a23a4874838e26de6f025e02fc63328921a4c;
+          sha256 = "17rxrkyzxa6x5nn7qhhhdgx4z0nlznnq5fifza4wv9znca8bbwyc";
+        };
+      };
+    };
+    "symfony/monolog-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-monolog-bundle-8781649349fe418d51d194f8c9d212c0b97c40dd";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/monolog-bundle/zipball/8781649349fe418d51d194f8c9d212c0b97c40dd;
+          sha256 = "0wcqhg1vfdj3mxacr3fxpgqwy1rk9znjg9bmzx4jymk8l16i7bq8";
+        };
+      };
+    };
+    "symfony/polyfill-apcu" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-apcu-9b83bd010112ec196410849e840d9b9fefcb15ad";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-apcu/zipball/9b83bd010112ec196410849e840d9b9fefcb15ad;
+          sha256 = "0iiiqbn0bs0zqc95nz8l1qa5ysy0iifx4f27r9wnhzsh6f1h02mv";
+        };
+      };
+    };
+    "symfony/polyfill-intl-icu" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-intl-icu-80ee17ae83c10cd513e5144f91a73607a21edb4e";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/80ee17ae83c10cd513e5144f91a73607a21edb4e;
+          sha256 = "1hck9bn8zfb1pmx2yccf4w5dd9rbmvwii7hncin6px6nasi6wzvv";
+        };
+      };
+    };
+    "symfony/polyfill-mbstring" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-mbstring-3296adf6a6454a050679cde90f95350ad604b171";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171;
+          sha256 = "02wyx9fjx9lyc5q5d3bnn8aw9xag8im2wqanmbkljwd5vmx9k9b2";
+        };
+      };
+    };
+    "symfony/polyfill-php56" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-php56-af98553c84912459db3f636329567809d639a8f6";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-php56/zipball/af98553c84912459db3f636329567809d639a8f6;
+          sha256 = "1l1ydsd7cq3s97cpgl4fw1qxc2wmv27yfxa3q8ng9p66ypzvkw42";
+        };
+      };
+    };
+    "symfony/polyfill-php70" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-php70-77454693d8f10dd23bb24955cffd2d82db1007a6";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6;
+          sha256 = "146d620ca725iqdh7j0dqb99h20d4vs641c9vjy9x4jws3rgj905";
+        };
+      };
+    };
+    "symfony/polyfill-util" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-polyfill-util-1a5ad95d9436cbff3296034fe9f8d586dce3fb3a";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/polyfill-util/zipball/1a5ad95d9436cbff3296034fe9f8d586dce3fb3a;
+          sha256 = "0l7w4dlr7y3qijpaiq7hfhbhv1qqz9jjknr1n6k4vrss2a8d1sxk";
+        };
+      };
+    };
+    "symfony/swiftmailer-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-swiftmailer-bundle-c4808f5169efc05567be983909d00f00521c53ec";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/swiftmailer-bundle/zipball/c4808f5169efc05567be983909d00f00521c53ec;
+          sha256 = "0jmd3slhb3gf3c3krmk2a9fi4ixdxvqlimdkfpj0sfaaq0115y01";
+        };
+      };
+    };
+    "symfony/symfony" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-symfony-4babd75194d45f7a4412560038924f3008c67ef2";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/symfony/zipball/4babd75194d45f7a4412560038924f3008c67ef2;
+          sha256 = "1347qp994yg6k91v5gwdwnn202bz92m0pj4090b59z5nqxh7463d";
+        };
+      };
+    };
+    "twig/extensions" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "twig-extensions-d188c76168b853481cc75879ea045bf93d718e9c";
+        src = fetchurl {
+          url = https://api.github.com/repos/twigphp/Twig-extensions/zipball/d188c76168b853481cc75879ea045bf93d718e9c;
+          sha256 = "0d6wywys5fqzi3m8g8h3sb5phl5y3a7vfc95n214mqp0iwrcmzwm";
+        };
+      };
+    };
+    "twig/twig" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "twig-twig-b48680b6eb7d16b5025b9bfc4108d86f6b8af86f";
+        src = fetchurl {
+          url = https://api.github.com/repos/twigphp/Twig/zipball/b48680b6eb7d16b5025b9bfc4108d86f6b8af86f;
+          sha256 = "1q82f246wq7whl11lx00n0skwmllppvpzg20x6q4frmw44dc6v9a";
+        };
+      };
+    };
+    "willdurand/jsonp-callback-validator" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "willdurand-jsonp-callback-validator-1a7d388bb521959e612ef50c5c7b1691b097e909";
+        src = fetchurl {
+          url = https://api.github.com/repos/willdurand/JsonpCallbackValidator/zipball/1a7d388bb521959e612ef50c5c7b1691b097e909;
+          sha256 = "19ds8f3nbss4b2xvqkcjkcvz0l4c5nhrm8w8yxc8a508r0jmd9in";
+        };
+      };
+    };
+    "zendframework/zend-code" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "zendframework-zend-code-95033f061b083e16cdee60530ec260d7d628b887";
+        src = fetchurl {
+          url = https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887;
+          sha256 = "0h77qf267l2sp9wg3n61dpgpf6wh6p5jssy8mrg7vlns2j03f9f5";
+        };
+      };
+    };
+    "zendframework/zend-eventmanager" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "zendframework-zend-eventmanager-a5e2583a211f73604691586b8406ff7296a946dd";
+        src = fetchurl {
+          url = https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd;
+          sha256 = "08a05gn40hfdy2zhz4gcd3r6q7m7zcaks5kpvb9dx1awgx0pzr8n";
+        };
+      };
+    };
+  };
+  devPackages = {
+    "doctrine/data-fixtures" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-data-fixtures-17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/data-fixtures/zipball/17fa5bfe6ff52e35cb3d9ec37c934a2f4bd1fa2e;
+          sha256 = "15k7vl58kwh02g0a93rab82ifbgmc91srgminzlkjq5kx8agh7ab";
+        };
+      };
+    };
+    "doctrine/doctrine-fixtures-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "doctrine-doctrine-fixtures-bundle-74b8cc70a4a25b774628ee59f4cdf3623a146273";
+        src = fetchurl {
+          url = https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/74b8cc70a4a25b774628ee59f4cdf3623a146273;
+          sha256 = "1bbflq8k6izwqgp9ka2gyb5y96a80b4lnlc5wrgc5gnih7hqidlf";
+        };
+      };
+    };
+    "sensio/generator-bundle" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "sensio-generator-bundle-28cbaa244bd0816fd8908b93f90380bcd7b67a65";
+        src = fetchurl {
+          url = https://api.github.com/repos/sensiolabs/SensioGeneratorBundle/zipball/28cbaa244bd0816fd8908b93f90380bcd7b67a65;
+          sha256 = "1j09y037xk843q8gcyfmwgy6dmn0h67pd5jnsvhj08h92ssbl0c3";
+        };
+      };
+    };
+    "symfony/phpunit-bridge" = {
+      targetDir = "";
+      src = composerEnv.buildZipPackage {
+        name = "symfony-phpunit-bridge-7470518370113785f67a7fd8e6e1667661e88805";
+        src = fetchurl {
+          url = https://api.github.com/repos/symfony/phpunit-bridge/zipball/7470518370113785f67a7fd8e6e1667661e88805;
+          sha256 = "0jd28ag0wks9sv62rkwsbx68csvdl5gabbz2h01hkqpa23gdkhs9";
+        };
+      };
+    };
+  };
+}
index 59b9e47412adfb573ac7aa3aa1cd1febc66a0f52..06f51ff935752dd2d9a7c2926069c4c1c98bd52e 100644 (file)
@@ -166,6 +166,9 @@ in
         #   '';
       });
       phpPackages = oldpkgs.php72Packages.override { inherit php; };
+      composerEnv = import ./commons/composer-env.nix {
+        inherit (pkgs) stdenv writeTextFile fetchurl php unzip;
+      };
     };
 
     services.myWebsites.tools.databases.enable = true;