diff options
Diffstat (limited to 'virtual/modules/websites/ludivine')
-rw-r--r-- | virtual/modules/websites/ludivine/default.nix | 12 | ||||
-rw-r--r-- | virtual/modules/websites/ludivine/ludivinecassal.nix | 28 |
2 files changed, 18 insertions, 22 deletions
diff --git a/virtual/modules/websites/ludivine/default.nix b/virtual/modules/websites/ludivine/default.nix index 6aa1862..d13d700 100644 --- a/virtual/modules/websites/ludivine/default.nix +++ b/virtual/modules/websites/ludivine/default.nix | |||
@@ -1,8 +1,12 @@ | |||
1 | { lib, pkgs, config, mylibs, ... }: | 1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
2 | let | 2 | let |
3 | ludivinecassal = pkgs.callPackage ./ludivinecassal.nix { inherit (mylibs) checkEnv fetchedGitPrivate; }; | 3 | ludivinecassal = pkgs.callPackage ./ludivinecassal.nix { inherit (mylibs) fetchedGitPrivate; }; |
4 | ludivinecassal_dev = ludivinecassal { environment = "dev"; }; | 4 | ludivinecassal_dev = ludivinecassal { |
5 | ludivinecassal_prod = ludivinecassal { environment = "prod"; }; | 5 | config = myconfig.env.websites.ludivinecassal.integration; |
6 | }; | ||
7 | ludivinecassal_prod = ludivinecassal { | ||
8 | config = myconfig.env.websites.ludivinecassal.production; | ||
9 | }; | ||
6 | 10 | ||
7 | cfg = config.services.myWebsites.Ludivine; | 11 | cfg = config.services.myWebsites.Ludivine; |
8 | in { | 12 | in { |
diff --git a/virtual/modules/websites/ludivine/ludivinecassal.nix b/virtual/modules/websites/ludivine/ludivinecassal.nix index 138ea9f..342c698 100644 --- a/virtual/modules/websites/ludivine/ludivinecassal.nix +++ b/virtual/modules/websites/ludivine/ludivinecassal.nix | |||
@@ -1,30 +1,22 @@ | |||
1 | { lib, checkEnv, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, ruby, sass, imagemagick }: | 1 | { lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, ruby, sass, imagemagick }: |
2 | let | 2 | let |
3 | ludivinecassal = { environment ? "dev" }: rec { | 3 | ludivinecassal = { config }: rec { |
4 | varPrefix = "LUDIVINECASSAL"; | 4 | environment = config.environment; |
5 | varDir = "/var/lib/ludivinecassal_${environment}"; | 5 | varDir = "/var/lib/ludivinecassal_${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 | assert checkEnv "NIXOPS_${varPrefix}_${envName}_LDAP_PASSWORD"; | ||
13 | assert checkEnv "NIXOPS_${varPrefix}_${envName}_LDAP_SEARCH_DN"; | ||
14 | assert checkEnv "NIXOPS_${varPrefix}_${envName}_LDAP_SEARCH_FILTER"; | ||
15 | writeText "parameters.yml" '' | 7 | writeText "parameters.yml" '' |
16 | # This file is auto-generated during the composer install | 8 | # This file is auto-generated during the composer install |
17 | parameters: | 9 | parameters: |
18 | database_host: db-1.immae.eu | 10 | database_host: db-1.immae.eu |
19 | database_port: null | 11 | database_port: null |
20 | database_name: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_NAME"} | 12 | database_name: ${config.mysql.name} |
21 | database_user: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_USER"} | 13 | database_user: ${config.mysql.user} |
22 | database_password: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_MYSQL_PASSWORD"} | 14 | database_password: ${config.mysql.password} |
23 | mailer_transport: smtp | 15 | mailer_transport: smtp |
24 | mailer_host: mail.immae.eu | 16 | mailer_host: mail.immae.eu |
25 | mailer_user: null | 17 | mailer_user: null |
26 | mailer_password: null | 18 | mailer_password: null |
27 | secret: ${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_SECRET"} | 19 | secret: ${config.secret} |
28 | ldap_host: ldap.immae.eu | 20 | ldap_host: ldap.immae.eu |
29 | ldap_port: 636 | 21 | ldap_port: 636 |
30 | ldap_version: 3 | 22 | ldap_version: 3 |
@@ -32,9 +24,9 @@ let | |||
32 | ldap_tls: false | 24 | ldap_tls: false |
33 | ldap_user_bind: 'uid={username},ou=users,dc=immae,dc=eu' | 25 | ldap_user_bind: 'uid={username},ou=users,dc=immae,dc=eu' |
34 | ldap_base_dn: 'dc=immae,dc=eu' | 26 | ldap_base_dn: 'dc=immae,dc=eu' |
35 | ldap_search_dn: '${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_LDAP_SEARCH_DN"}' | 27 | ldap_search_dn: '${config.ldap.dn}' |
36 | ldap_search_password: '${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_LDAP_PASSWORD"}' | 28 | ldap_search_password: '${config.ldap.password}' |
37 | ldap_search_filter: '${builtins.getEnv "NIXOPS_${varPrefix}_${envName}_LDAP_SEARCH_FILTER"}' | 29 | ldap_search_filter: '${config.ldap.search}' |
38 | leapt_im: | 30 | leapt_im: |
39 | binary_path: ${imagemagick}/bin | 31 | binary_path: ${imagemagick}/bin |
40 | assetic: | 32 | assetic: |