aboutsummaryrefslogtreecommitdiff
path: root/virtual/modules/websites/tellesflorian/tellesflorian.nix
diff options
context:
space:
mode:
Diffstat (limited to 'virtual/modules/websites/tellesflorian/tellesflorian.nix')
-rw-r--r--virtual/modules/websites/tellesflorian/tellesflorian.nix25
1 files changed, 9 insertions, 16 deletions
diff --git a/virtual/modules/websites/tellesflorian/tellesflorian.nix b/virtual/modules/websites/tellesflorian/tellesflorian.nix
index 2191b31..03b1faf 100644
--- a/virtual/modules/websites/tellesflorian/tellesflorian.nix
+++ b/virtual/modules/websites/tellesflorian/tellesflorian.nix
@@ -1,27 +1,22 @@
1{ lib, checkEnv, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages }: 1{ lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages }:
2let 2let
3 tellesflorian = { environment ? "dev" }: rec { 3 tellesflorian = { config }: rec {
4 varPrefix = "TELLESFLORIAN"; 4 environment = config.environment;
5 varDir = "/var/lib/tellesflorian_${environment}"; 5 varDir = "/var/lib/tellesflorian_${environment}";
6 envName= lib.strings.toUpper environment;
7 configRoot = 6 configRoot =
8 assert checkEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_PASSWORD";
9 assert checkEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_USER";
10 assert checkEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_NAME";
11 assert checkEnv "NIXOPS_${varPrefix}_${envName}_SECRET";
12 writeText "parameters.yml" '' 7 writeText "parameters.yml" ''
13 # This file is auto-generated during the composer install 8 # This file is auto-generated during the composer install
14 parameters: 9 parameters:
15 database_host: db-1.immae.eu 10 database_host: db-1.immae.eu
16 database_port: null 11 database_port: null
17 database_name: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_NAME"} 12 database_name: ${config.mysql.name}
18 database_user: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_USER"} 13 database_user: ${config.mysql.user}
19 database_password: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_PASSWORD"} 14 database_password: ${config.mysql.password}
20 mailer_transport: smtp 15 mailer_transport: smtp
21 mailer_host: mail.immae.eu 16 mailer_host: mail.immae.eu
22 mailer_user: null 17 mailer_user: null
23 mailer_password: null 18 mailer_password: null
24 secret: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_SECRET"} 19 secret: ${config.secret}
25 ''; 20 '';
26 phpFpm = rec { 21 phpFpm = rec {
27 socket = "/var/run/phpfpm/floriantelles-${environment}.sock"; 22 socket = "/var/run/phpfpm/floriantelles-${environment}.sock";
@@ -49,10 +44,8 @@ let
49 pm.max_spare_servers = 3 44 pm.max_spare_servers = 3
50 ''}''; 45 ''}'';
51 }; 46 };
52 passwords = 47 passwords = writeText "tellesflorian_passwords" ''
53 assert checkEnv "NIXOPS_${varPrefix}_${envName}_INVITE_PASSWORDS"; 48 invite:${config.invite_passwords}
54 writeText "tellesflorian_passwords" ''
55 invite:${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_INVITE_PASSWORDS"}
56 ''; 49 '';
57 apache = { 50 apache = {
58 user = "wwwrun"; 51 user = "wwwrun";