aboutsummaryrefslogtreecommitdiff
path: root/pkgs/private/webapps/tellesflorian/default.nix
blob: b1ccb980ab8b0d1b4382f5fb9e5231d2ba3aa205 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ environment ? "prod"
, varDir ? "/var/lib/tellesflorian_${environment}"
, composerEnv, fetchurl, mylibs }:
let
  app = composerEnv.buildPackage (
    import ./php-packages.nix { inherit composerEnv fetchurl; } //
    mylibs.fetchedGitPrivate ./tellesflorian.json //
    rec {
      noDev = (environment == "prod");
      preInstall = ''
        export SYMFONY_ENV="${environment}"
        '';
      postInstall = ''
        cd $out
        rm app/config/parameters.yml
        ln -sf /var/secrets/webapps/${environment}-tellesflorian app/config/parameters.yml
        rm -rf var/{logs,cache}
        ln -sf ${varDir}/var/{logs,cache,sessions} var/
        '';
      passthru = {
        inherit varDir environment;
        webRoot = "${app}/web";
      };
    });
in app