]>
Commit | Line | Data |
---|---|---|
1 | { environment ? "prod" | |
2 | , varDir ? "/var/lib/piedsjaloux_${environment}" | |
3 | , secretsPath ? "/var/secrets/webapps/${environment}-piedsjaloux" | |
4 | , composerEnv, fetchurl, fetchgit, mylibs }: | |
5 | let | |
6 | app = composerEnv.buildPackage ( | |
7 | import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } // | |
8 | mylibs.fetchedGitPrivate ./piedsjaloux.json // | |
9 | rec { | |
10 | noDev = (environment == "prod"); | |
11 | preInstall = '' | |
12 | export SYMFONY_ENV="${environment}" | |
13 | ''; | |
14 | # /!\ miniatures and data need to be in the same physical dir due to a | |
15 | # bug in leapt.im (searches for data/../miniatures) | |
16 | postInstall = '' | |
17 | cd $out | |
18 | rm app/config/parameters.yml | |
19 | ln -sf ${secretsPath} app/config/parameters.yml | |
20 | rm -rf var/{logs,cache,data,miniatures,tmp} | |
21 | ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/ | |
22 | ''; | |
23 | passthru = { | |
24 | inherit varDir environment secretsPath; | |
25 | webRoot = "${app}/web"; | |
26 | }; | |
27 | }); | |
28 | in app |