]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/florian/app/default.nix
Migrate mylibs to niv (work in progress)
[perso/Immae/Config/Nix.git] / modules / private / websites / florian / app / default.nix
1 { environment ? "prod"
2 , varDir ? "/var/lib/tellesflorian_${environment}"
3 , secretsPath ? "/var/secrets/webapps/${environment}-tellesflorian"
4 , composerEnv, fetchurl, sources }:
5 let
6 app = composerEnv.buildPackage (
7 import ./php-packages.nix { inherit composerEnv fetchurl; } //
8 rec {
9 version = sources.websites-florian-app.version;
10 pname = "tellesflorian";
11 name = "${pname}-${version}";
12 src = sources.websites-florian-app;
13 noDev = (environment == "prod");
14 preInstall = ''
15 export SYMFONY_ENV="${environment}"
16 '';
17 postInstall = ''
18 cd $out
19 rm app/config/parameters.yml
20 ln -sf ${secretsPath} app/config/parameters.yml
21 rm -rf var/{logs,cache}
22 ln -sf ${varDir}/var/{logs,cache,sessions} var/
23 '';
24 passthru = {
25 inherit varDir environment;
26 webRoot = "${app}/web";
27 };
28 });
29 in app