X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=virtual%2Fmodules%2Fwebsites%2Fpiedsjaloux%2Fpiedsjaloux.nix;h=1b53c4a5022e0531ca3cf2591512aa869d2b53c7;hb=85545c3fc60140bca90a3c2e49f41ff6bdd93c79;hp=3d30b894a8f03e9f3126e4053743e0a90893b31d;hpb=f406130d33a65afa5a4fb45fb3586ce97fd7b772;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/virtual/modules/websites/piedsjaloux/piedsjaloux.nix b/virtual/modules/websites/piedsjaloux/piedsjaloux.nix index 3d30b89..1b53c4a 100644 --- a/virtual/modules/websites/piedsjaloux/piedsjaloux.nix +++ b/virtual/modules/websites/piedsjaloux/piedsjaloux.nix @@ -1,4 +1,4 @@ -{ lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, texlive, imagemagick }: +{ pkgs, lib, writeText, fetchedGitPrivate, stdenv, composerEnv, fetchurl, fetchgit, texlive, imagemagick }: let piedsjaloux = { config }: rec { environment = config.environment; @@ -12,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 @@ -129,30 +130,24 @@ let fi ''; }; - webappDir = stdenv.mkDerivation (fetchedGitPrivate ./piedsjaloux.json // rec { - # /!\ miniatures and data need to be in the same dir due to a - # bug in leapt.im (searches for data/../miniatures) - 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 ${configRoot} app/config/parameters.yml - sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json - ${if environment == "dev" then '' - composer install - '' else '' - SYMFONY_ENV=prod composer install --no-dev - ''} - rm -rf var - ln -sf ../../../../../${varDir} var - ''; - installPhase = '' - cp -a . $out - ''; - buildInputs = [ - php git cacert phpPackages.composer - ]; - }); + webappDir = composerEnv.buildPackage ( + import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } // + fetchedGitPrivate ./piedsjaloux.json // + rec { + noDev = (environment == "prod"); + preInstall = '' + export SYMFONY_ENV="${environment}" + ''; + # /!\ miniatures and data need to be in the same physical dir due to a + # bug in leapt.im (searches for data/../miniatures) + postInstall = '' + cd $out + rm app/config/parameters.yml + ln -sf ${configRoot} app/config/parameters.yml + rm -rf var/{logs,cache,data,miniatures,tmp} + ln -sf ../../../../../../../${varDir}/{logs,cache,data,miniatures,tmp} var/ + ''; + }); webRoot = "${webappDir}/web"; }; in