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