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