]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - 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
CommitLineData
c890321d
IB
1{ environment ? "prod"
2, varDir ? "/var/lib/tellesflorian_${environment}"
d3452fc5 3, secretsPath ? "/var/secrets/webapps/${environment}-tellesflorian"
db343436 4, composerEnv, fetchurl, sources }:
c890321d
IB
5let
6 app = composerEnv.buildPackage (
7 import ./php-packages.nix { inherit composerEnv fetchurl; } //
c890321d 8 rec {
db343436
IB
9 version = sources.websites-florian-app.version;
10 pname = "tellesflorian";
11 name = "${pname}-${version}";
12 src = sources.websites-florian-app;
c890321d
IB
13 noDev = (environment == "prod");
14 preInstall = ''
15 export SYMFONY_ENV="${environment}"
16 '';
17 postInstall = ''
18 cd $out
19 rm app/config/parameters.yml
d3452fc5 20 ln -sf ${secretsPath} app/config/parameters.yml
c890321d
IB
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 });
29in app