]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/piedsjaloux/app/default.nix
Refactor websites
[perso/Immae/Config/Nix.git] / modules / private / websites / piedsjaloux / app / default.nix
CommitLineData
313d19ce
IB
1{ environment ? "prod"
2, varDir ? "/var/lib/piedsjaloux_${environment}"
d3452fc5 3, secretsPath ? "/var/secrets/webapps/${environment}-piedsjaloux"
313d19ce
IB
4, composerEnv, fetchurl, fetchgit, mylibs }:
5let
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
d3452fc5 19 ln -sf ${secretsPath} app/config/parameters.yml
313d19ce
IB
20 rm -rf var/{logs,cache,data,miniatures,tmp}
21 ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/
22 '';
23 passthru = {
d3452fc5 24 inherit varDir environment secretsPath;
313d19ce
IB
25 webRoot = "${app}/web";
26 };
27 });
28in app