diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-12-12 00:24:23 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-12-20 04:12:27 +0100 |
commit | ab8f306d7c2c49b8116e1af7b355ed2384617ed9 (patch) | |
tree | d1061ec0436fd096de2332a892eb984c63cb125e /modules/private/websites/aten/integration.nix | |
parent | 4227853a03923e04daf3dd511a4b5a1ab5d527e7 (diff) | |
download | Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.tar.gz Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.tar.zst Nix-ab8f306d7c2c49b8116e1af7b355ed2384617ed9.zip |
Add specification for the private config file as a module.
Diffstat (limited to 'modules/private/websites/aten/integration.nix')
-rw-r--r-- | modules/private/websites/aten/integration.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/private/websites/aten/integration.nix b/modules/private/websites/aten/integration.nix index 7aadf58..7e12b38 100644 --- a/modules/private/websites/aten/integration.nix +++ b/modules/private/websites/aten/integration.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | secrets = myconfig.env.websites.aten.integration; | 3 | secrets = config.myEnv.websites.aten.integration; |
4 | app = pkgs.webapps.aten.override { environment = secrets.environment; }; | 4 | app = pkgs.webapps.aten.override { environment = secrets.environment; }; |
5 | cfg = config.myServices.websites.aten.integration; | 5 | cfg = config.myServices.websites.aten.integration; |
6 | pcfg = config.services.phpApplication; | 6 | pcfg = config.services.phpApplication; |
@@ -39,10 +39,15 @@ in { | |||
39 | user = config.services.httpd.Inte.user; | 39 | user = config.services.httpd.Inte.user; |
40 | group = config.services.httpd.Inte.group; | 40 | group = config.services.httpd.Inte.group; |
41 | permissions = "0400"; | 41 | permissions = "0400"; |
42 | text = '' | 42 | text = let |
43 | # cf: | ||
44 | # https://secure.php.net/manual/fr/function.parse-url.php | ||
45 | # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery | ||
46 | psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}"; | ||
47 | in '' | ||
43 | SetEnv APP_ENV "${app.environment}" | 48 | SetEnv APP_ENV "${app.environment}" |
44 | SetEnv APP_SECRET "${secrets.secret}" | 49 | SetEnv APP_SECRET "${secrets.secret}" |
45 | SetEnv DATABASE_URL "${secrets.psql_url}" | 50 | SetEnv DATABASE_URL "${psql_url}" |
46 | ''; | 51 | ''; |
47 | }]; | 52 | }]; |
48 | services.websites.env.integration.vhostConfs.aten_dev = { | 53 | services.websites.env.integration.vhostConfs.aten_dev = { |