2 , varDir ? "/var/lib/ludivinecassal_${environment}"
3 , secretsPath ? "/var/secrets/webapps/${environment}-ludivinecassal"
4 , composerEnv, fetchurl, fetchgit, imagemagick, sass, ruby, sources }:
6 app = composerEnv.buildPackage (
7 import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
9 name = "${pname}-${version}";
10 pname = "ludivinecassal";
11 version = sources.websites-ludivine-app.version;
12 src = sources.websites-ludivine-app;
13 noDev = (environment == "prod");
15 export SYMFONY_ENV="${environment}"
16 cp app/config/parameters.yml.dist app/config/parameters.yml
17 cat >> app/config/parameters.yml <<EOF
19 binary_path: ${imagemagick}/bin
21 sass: ${sass}/bin/sass
22 ruby: ${ruby}/bin/ruby
24 sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json
26 # /!\ miniatures and data need to be in the same physical dir due to a
27 # bug in leapt.im (searches for data/../miniatures)
29 rm -rf var/{logs,cache,data,miniatures,tmp}
30 ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/
31 ln -sf ${secretsPath} app/config/parameters.yml
33 buildInputs = [ sass ];
35 inherit varDir environment;
36 webRoot = "${app}/web";