diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-11 15:57:00 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-11 15:57:00 +0200 |
commit | 52e8779df7834db6f8308397965d58ffc87f129a (patch) | |
tree | ca6f08f8c643cf964710933b68c96aba36f33ca4 /pkgs/private/webapps/connexionswing/default.nix | |
parent | 1bd8b03eeaafa9345282d8aaf6499bc80adf062f (diff) | |
download | Nix-52e8779df7834db6f8308397965d58ffc87f129a.tar.gz Nix-52e8779df7834db6f8308397965d58ffc87f129a.tar.zst Nix-52e8779df7834db6f8308397965d58ffc87f129a.zip |
Move connexionswing package to pkgs
Diffstat (limited to 'pkgs/private/webapps/connexionswing/default.nix')
-rw-r--r-- | pkgs/private/webapps/connexionswing/default.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pkgs/private/webapps/connexionswing/default.nix b/pkgs/private/webapps/connexionswing/default.nix new file mode 100644 index 0000000..04e296b --- /dev/null +++ b/pkgs/private/webapps/connexionswing/default.nix | |||
@@ -0,0 +1,27 @@ | |||
1 | { environment ? "prod" | ||
2 | , varDir ? "/var/lib/connexionswing_${environment}" | ||
3 | , composerEnv, fetchurl, fetchgit, mylibs }: | ||
4 | let | ||
5 | app = composerEnv.buildPackage ( | ||
6 | import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } // | ||
7 | mylibs.fetchedGitPrivate ./connexionswing.json // | ||
8 | rec { | ||
9 | noDev = (environment == "prod"); | ||
10 | preInstall = '' | ||
11 | export SYMFONY_ENV="${environment}" | ||
12 | ''; | ||
13 | postInstall = '' | ||
14 | cd $out | ||
15 | ${if environment == "prod" then "php ./bin/console assetic:dump --env=prod --no-debug" else ""} | ||
16 | rm app/config/parameters.yml | ||
17 | ln -sf /var/secrets/webapps/${environment}-connexionswing app/config/parameters.yml | ||
18 | rm -rf var/{logs,cache} | ||
19 | ln -sf ${varDir}/var/{logs,cache} var/ | ||
20 | ln -sf ${varDir}/{medias,uploads} web/images/ | ||
21 | ''; | ||
22 | passthru = { | ||
23 | inherit varDir environment; | ||
24 | webRoot = "${app}/web"; | ||
25 | }; | ||
26 | }); | ||
27 | in app | ||