aboutsummaryrefslogtreecommitdiff
path: root/pkgs/private/webapps/ludivinecassal/default.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 16:09:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-05-11 16:09:06 +0200
commitb3c0779fd2c9bfce7af4bfcb8aa601795ffca8c0 (patch)
treee6ffaebc409125b92d5a2ab4f9c4cc73f9c1482c /pkgs/private/webapps/ludivinecassal/default.nix
parent52e8779df7834db6f8308397965d58ffc87f129a (diff)
downloadNix-b3c0779fd2c9bfce7af4bfcb8aa601795ffca8c0.tar.gz
Nix-b3c0779fd2c9bfce7af4bfcb8aa601795ffca8c0.tar.zst
Nix-b3c0779fd2c9bfce7af4bfcb8aa601795ffca8c0.zip
Move Ludivine website to pkgs
Diffstat (limited to 'pkgs/private/webapps/ludivinecassal/default.nix')
-rw-r--r--pkgs/private/webapps/ludivinecassal/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/private/webapps/ludivinecassal/default.nix b/pkgs/private/webapps/ludivinecassal/default.nix
new file mode 100644
index 0000000..3401435
--- /dev/null
+++ b/pkgs/private/webapps/ludivinecassal/default.nix
@@ -0,0 +1,35 @@
1{ environment ? "prod"
2, varDir ? "/var/lib/ludivinecassal_${environment}"
3, composerEnv, fetchurl, fetchgit, imagemagick, sass, ruby, mylibs }:
4let
5 app = composerEnv.buildPackage (
6 import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
7 mylibs.fetchedGitPrivate ./ludivinecassal.json //
8 rec {
9 noDev = (environment == "prod");
10 preInstall = ''
11 export SYMFONY_ENV="${environment}"
12 cp app/config/parameters.yml.dist app/config/parameters.yml
13 cat >> app/config/parameters.yml <<EOF
14 leapt_im:
15 binary_path: ${imagemagick}/bin
16 assetic:
17 sass: ${sass}/bin/sass
18 ruby: ${ruby}/bin/ruby
19 EOF
20 sed -i -e "/Incenteev..ParameterHandler..ScriptHandler::buildParameters/d" composer.json
21 '';
22 # /!\ miniatures and data need to be in the same physical dir due to a
23 # bug in leapt.im (searches for data/../miniatures)
24 postInstall = ''
25 rm -rf var/{logs,cache,data,miniatures,tmp}
26 ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/
27 ln -sf /var/secrets/webapps/${environment}-ludivinecassal app/config/parameters.yml
28 '';
29 buildInputs = [ sass ];
30 passthru = {
31 inherit varDir environment;
32 webRoot = "${app}/web";
33 };
34 });
35in app