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