]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/piedsjaloux/app/default.nix
726d93c2a7e262c1a03098e5855c97165af78000
[perso/Immae/Config/Nix.git] / modules / private / websites / piedsjaloux / app / default.nix
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