diff options
Diffstat (limited to 'virtual/modules/websites/ludivine/ludivinecassal.nix')
-rw-r--r-- | virtual/modules/websites/ludivine/ludivinecassal.nix | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/virtual/modules/websites/ludivine/ludivinecassal.nix b/virtual/modules/websites/ludivine/ludivinecassal.nix index 342c698..eff0bf8 100644 --- a/virtual/modules/websites/ludivine/ludivinecassal.nix +++ b/virtual/modules/websites/ludivine/ludivinecassal.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, ruby, sass, imagemagick }: | 1 | { pkgs, lib, writeText, fetchedGitPrivate, stdenv, composerEnv, fetchurl, fetchgit, ruby, sass, imagemagick }: |
2 | let | 2 | let |
3 | ludivinecassal = { config }: rec { | 3 | ludivinecassal = { config }: rec { |
4 | environment = config.environment; | 4 | environment = config.environment; |
@@ -12,6 +12,7 @@ let | |||
12 | database_name: ${config.mysql.name} | 12 | database_name: ${config.mysql.name} |
13 | database_user: ${config.mysql.user} | 13 | database_user: ${config.mysql.user} |
14 | database_password: ${config.mysql.password} | 14 | database_password: ${config.mysql.password} |
15 | database_server_version: ${pkgs.mariadb.mysqlVersion} | ||
15 | mailer_transport: smtp | 16 | mailer_transport: smtp |
16 | mailer_host: mail.immae.eu | 17 | mailer_host: mail.immae.eu |
17 | mailer_user: null | 18 | mailer_user: null |
@@ -141,30 +142,24 @@ let | |||
141 | fi | 142 | fi |
142 | ''; | 143 | ''; |
143 | }; | 144 | }; |
144 | webappDir = stdenv.mkDerivation (fetchedGitPrivate ./ludivinecassal.json // rec { | 145 | webappDir = composerEnv.buildPackage ( |
145 | # /!\ miniatures and data need to be in the same dir due to a | 146 | import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } // |
146 | # bug in leapt.im (searches for data/../miniatures) | 147 | fetchedGitPrivate ./ludivinecassal.json // |
147 | buildPhase = '' | 148 | rec { |
148 | export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt | 149 | noDev = (environment == "prod"); |
149 | export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt | 150 | preInstall = '' |
150 | 151 | export SYMFONY_ENV="${environment}" | |
151 | ln -sf ${configRoot} app/config/parameters.yml | 152 | ln -sf ${configRoot} app/config/parameters.yml |
152 | sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json | 153 | sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json |
153 | ${if environment == "dev" then '' | 154 | ''; |
154 | composer install | 155 | # /!\ miniatures and data need to be in the same physical dir due to a |
155 | '' else '' | 156 | # bug in leapt.im (searches for data/../miniatures) |
156 | SYMFONY_ENV=prod composer install --no-dev | 157 | postInstall = '' |
157 | ''} | 158 | rm -rf var/{logs,cache,data,miniatures,tmp} |
158 | rm -rf var | 159 | ln -sf ../../../../../../../${varDir}/{logs,cache,data,miniatures,tmp} var/ |
159 | ln -sf ../../../../../${varDir} var | 160 | ''; |
160 | ''; | 161 | buildInputs = [ sass ]; |
161 | installPhase = '' | 162 | }); |
162 | cp -a . $out | ||
163 | ''; | ||
164 | buildInputs = [ | ||
165 | php git cacert phpPackages.composer sass | ||
166 | ]; | ||
167 | }); | ||
168 | webRoot = "${webappDir}/web"; | 163 | webRoot = "${webappDir}/web"; |
169 | }; | 164 | }; |
170 | in | 165 | in |