]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/connexionswing/app/default.nix
Migrate mylibs to niv (work in progress)
[perso/Immae/Config/Nix.git] / modules / private / websites / connexionswing / app / default.nix
CommitLineData
52e8779d
IB
1{ environment ? "prod"
2, varDir ? "/var/lib/connexionswing_${environment}"
d3452fc5 3, secretsPath ? "/var/secrets/webapps/${environment}-connexionswing"
db343436 4, composerEnv, fetchurl, fetchgit, sources }:
52e8779d
IB
5let
6 app = composerEnv.buildPackage (
7 import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
52e8779d 8 rec {
db343436
IB
9 pname = "connexionswing";
10 name = "${pname}-${version}";
11 version = sources.websites-connexionswing-app.version;
12 src = sources.websites-connexionswing-app;
52e8779d
IB
13 noDev = (environment == "prod");
14 preInstall = ''
15 export SYMFONY_ENV="${environment}"
16 '';
17 postInstall = ''
18 cd $out
19 ${if environment == "prod" then "php ./bin/console assetic:dump --env=prod --no-debug" else ""}
20 rm app/config/parameters.yml
d3452fc5 21 ln -sf ${secretsPath} app/config/parameters.yml
52e8779d
IB
22 rm -rf var/{logs,cache}
23 ln -sf ${varDir}/var/{logs,cache} var/
24 ln -sf ${varDir}/{medias,uploads} web/images/
25 '';
26 passthru = {
27 inherit varDir environment;
28 webRoot = "${app}/web";
29 };
30 });
31in app