aboutsummaryrefslogtreecommitdiff
path: root/virtual/modules/websites/tools/diaspora/diaspora.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-22 12:49:20 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-01-22 12:49:20 +0100
commit9d90e7e281e8f4cf9371c17c812a1ac9c08aa66d (patch)
tree0b011ca0aeeef02dce03a3c825d9a037c5cfc01a /virtual/modules/websites/tools/diaspora/diaspora.nix
parent0f3047a77ee1e0b3d943e39d50301ba85821c572 (diff)
downloadNix-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/tools/diaspora/diaspora.nix')
-rw-r--r--virtual/modules/websites/tools/diaspora/diaspora.nix19
1 files changed, 7 insertions, 12 deletions
diff --git a/virtual/modules/websites/tools/diaspora/diaspora.nix b/virtual/modules/websites/tools/diaspora/diaspora.nix
index 961e1f8..39de202 100644
--- a/virtual/modules/websites/tools/diaspora/diaspora.nix
+++ b/virtual/modules/websites/tools/diaspora/diaspora.nix
@@ -1,4 +1,4 @@
1{ checkEnv, fetchedGithub, stdenv, defaultGemConfig, writeText, bundlerEnv, ruby_2_4, pkgs, cacert }: 1{ env, fetchedGithub, stdenv, defaultGemConfig, writeText, bundlerEnv, ruby_2_4, pkgs, cacert }:
2let 2let
3 gems = bundlerEnv { 3 gems = bundlerEnv {
4 name = "diaspora-env"; 4 name = "diaspora-env";
@@ -30,13 +30,10 @@ let
30 ''; 30 '';
31 propagatedBuildInputs = buildInputs; 31 propagatedBuildInputs = buildInputs;
32 }); 32 });
33 secret_token = assert checkEnv "NIXOPS_DIASPORA_SECRET_TOKEN"; 33 secret_token = writeText "secret_token.rb" ''
34 writeText "secret_token.rb" '' 34 Diaspora::Application.config.secret_key_base = '${env.secret_token}'
35 Diaspora::Application.config.secret_key_base = '${builtins.getEnv "NIXOPS_DIASPORA_SECRET_TOKEN"}'
36 ''; 35 '';
37 config = 36 config = writeText "diaspora.yml" ''
38 assert checkEnv "NIXOPS_DIASPORA_LDAP_PASSWORD";
39 writeText "diaspora.yml" ''
40 configuration: 37 configuration:
41 environment: 38 environment:
42 url: "https://diaspora.immae.eu/" 39 url: "https://diaspora.immae.eu/"
@@ -101,7 +98,7 @@ let
101 skip_email_confirmation: true 98 skip_email_confirmation: true
102 use_bind_dn: true 99 use_bind_dn: true
103 bind_dn: "cn=diaspora,ou=services,dc=immae,dc=eu" 100 bind_dn: "cn=diaspora,ou=services,dc=immae,dc=eu"
104 bind_pw: "${builtins.getEnv "NIXOPS_DIASPORA_LDAP_PASSWORD"}" 101 bind_pw: "${env.ldap.password}"
105 search_base: "dc=immae,dc=eu" 102 search_base: "dc=immae,dc=eu"
106 search_filter: "(&(memberOf=cn=users,cn=diaspora,ou=services,dc=immae,dc=eu)(uid=%{username}))" 103 search_filter: "(&(memberOf=cn=users,cn=diaspora,ou=services,dc=immae,dc=eu)(uid=%{username}))"
107 production: 104 production:
@@ -109,15 +106,13 @@ let
109 development: 106 development:
110 environment: 107 environment:
111 ''; 108 '';
112 database_config = 109 database_config = writeText "database.yml" ''
113 assert checkEnv "NIXOPS_DIASPORA_SQL_PASSWORD";
114 writeText "database.yml" ''
115 postgresql: &postgresql 110 postgresql: &postgresql
116 adapter: postgresql 111 adapter: postgresql
117 host: db-1.immae.eu 112 host: db-1.immae.eu
118 port: 5432 113 port: 5432
119 username: "diaspora" 114 username: "diaspora"
120 password: "${builtins.getEnv "NIXOPS_DIASPORA_SQL_PASSWORD"}" 115 password: "${env.postgresql.password}"
121 encoding: unicode 116 encoding: unicode
122 common: &common 117 common: &common
123 <<: *postgresql 118 <<: *postgresql