]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/piedsjaloux/app/default.nix
Move secrets to flakes
[perso/Immae/Config/Nix.git] / modules / private / websites / piedsjaloux / app / default.nix
1 { environment, varDir, secretsPath
2 , composerEnv, fetchurl, fetchgit, sources }:
3 let
4 app = composerEnv.buildPackage (
5 import ./php-packages.nix { inherit composerEnv fetchurl fetchgit; } //
6 rec {
7 version = sources.websites-piedsjaloux-app.version;
8 pname = "piedsjaloux";
9 name = "${pname}-${version}";
10 src = sources.websites-piedsjaloux-app;
11 noDev = (environment == "prod");
12 preInstall = ''
13 export SYMFONY_ENV="${environment}"
14 '';
15 # /!\ miniatures and data need to be in the same physical dir due to a
16 # bug in leapt.im (searches for data/../miniatures)
17 postInstall = ''
18 cd $out
19 rm app/config/parameters.yml
20 ln -sf ${secretsPath} app/config/parameters.yml
21 rm -rf var/{logs,cache,data,miniatures,tmp}
22 ln -sf ${varDir}/{logs,cache,data,miniatures,tmp} var/
23 '';
24 passthru = {
25 inherit varDir environment secretsPath;
26 webRoot = "${app}/web";
27 };
28 });
29 in app