]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/piedsjaloux/app/default.nix
Migrate mylibs to niv (work in progress)
[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, sources }:
5 let
6 app = composerEnv.buildPackage (
7 import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
8 rec {
9 version = sources.websites-piedsjaloux-app.version;
10 pname = "piedsjaloux";
11 name = "${pname}-${version}";
12 src = sources.websites-piedsjaloux-app;
13 noDev = (environment == "prod");
14 preInstall = ''
15 export SYMFONY_ENV="${environment}"
16 '';
17 # /!\ miniatures and data need to be in the same physical dir due to a
18 # bug in leapt.im (searches for data/../miniatures)
19 postInstall = ''
20 cd $out
21 rm app/config/parameters.yml
22 ln -sf ${secretsPath} app/config/parameters.yml
23 rm -rf var/{logs,cache,data,miniatures,tmp}
24 ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/
25 '';
26 passthru = {
27 inherit varDir environment secretsPath;
28 webRoot = "${app}/web";
29 };
30 });
31 in app