diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-22 12:49:20 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-22 12:49:20 +0100 |
commit | 9d90e7e281e8f4cf9371c17c812a1ac9c08aa66d (patch) | |
tree | 0b011ca0aeeef02dce03a3c825d9a037c5cfc01a /virtual/modules/websites/piedsjaloux | |
parent | 0f3047a77ee1e0b3d943e39d50301ba85821c572 (diff) | |
download | Nix-9d90e7e281e8f4cf9371c17c812a1ac9c08aa66d.tar.gz Nix-9d90e7e281e8f4cf9371c17c812a1ac9c08aa66d.tar.zst Nix-9d90e7e281e8f4cf9371c17c812a1ac9c08aa66d.zip |
Remove use of environment variables
Fixes https://git.immae.eu/mantisbt/view.php?id=113
Diffstat (limited to 'virtual/modules/websites/piedsjaloux')
-rw-r--r-- | virtual/modules/websites/piedsjaloux/default.nix | 12 | ||||
-rw-r--r-- | virtual/modules/websites/piedsjaloux/piedsjaloux.nix | 19 |
2 files changed, 15 insertions, 16 deletions
diff --git a/virtual/modules/websites/piedsjaloux/default.nix b/virtual/modules/websites/piedsjaloux/default.nix index 80261a3..f1bb760 100644 --- a/virtual/modules/websites/piedsjaloux/default.nix +++ b/virtual/modules/websites/piedsjaloux/default.nix | |||
@@ -1,8 +1,12 @@ | |||
1 | { lib, pkgs, config, mylibs, ... }: | 1 | { lib, pkgs, config, myconfig, mylibs, ... }: |
2 | let | 2 | let |
3 | piedsjaloux = pkgs.callPackage ./piedsjaloux.nix { inherit (mylibs) checkEnv fetchedGitPrivate; }; | 3 | piedsjaloux = pkgs.callPackage ./piedsjaloux.nix { inherit (mylibs) fetchedGitPrivate; }; |
4 | piedsjaloux_dev = piedsjaloux { environment = "dev"; }; | 4 | piedsjaloux_dev = piedsjaloux { |
5 | piedsjaloux_prod = piedsjaloux { environment = "prod"; }; | 5 | config = myconfig.env.websites.piedsjaloux.integration; |
6 | }; | ||
7 | piedsjaloux_prod = piedsjaloux { | ||
8 | config = myconfig.env.websites.piedsjaloux.production; | ||
9 | }; | ||
6 | 10 | ||
7 | cfg = config.services.myWebsites.PiedsJaloux; | 11 | cfg = config.services.myWebsites.PiedsJaloux; |
8 | in { | 12 | in { |
diff --git a/virtual/modules/websites/piedsjaloux/piedsjaloux.nix b/virtual/modules/websites/piedsjaloux/piedsjaloux.nix index 4bbf148..3d30b89 100644 --- a/virtual/modules/websites/piedsjaloux/piedsjaloux.nix +++ b/virtual/modules/websites/piedsjaloux/piedsjaloux.nix | |||
@@ -1,27 +1,22 @@ | |||
1 | { lib, checkEnv, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, texlive, imagemagick }: | 1 | { lib, writeText, fetchedGitPrivate, stdenv, php, git, cacert, phpPackages, texlive, imagemagick }: |
2 | let | 2 | let |
3 | piedsjaloux = { environment ? "dev" }: rec { | 3 | piedsjaloux = { config }: rec { |
4 | varPrefix = "PIEDSJALOUX"; | 4 | environment = config.environment; |
5 | varDir = "/var/lib/piedsjaloux_${environment}"; | 5 | varDir = "/var/lib/piedsjaloux_${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 | pdflatex: "${texlive.combine { inherit (texlive) attachfile preprint scheme-small; }}/bin/pdflatex" | 20 | pdflatex: "${texlive.combine { inherit (texlive) attachfile preprint scheme-small; }}/bin/pdflatex" |
26 | leapt_im: | 21 | leapt_im: |
27 | binary_path: ${imagemagick}/bin | 22 | binary_path: ${imagemagick}/bin |