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/production.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/production.nix')
-rw-r--r-- | modules/private/websites/aten/production.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/private/websites/aten/production.nix b/modules/private/websites/aten/production.nix index 16a909a..1f72e61 100644 --- a/modules/private/websites/aten/production.nix +++ b/modules/private/websites/aten/production.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | { lib, pkgs, config, myconfig, ... }: | 1 | { lib, pkgs, config, ... }: |
2 | let | 2 | let |
3 | secrets = myconfig.env.websites.aten.production; | 3 | secrets = config.myEnv.websites.aten.production; |
4 | app = pkgs.webapps.aten.override { environment = secrets.environment; }; | 4 | app = pkgs.webapps.aten.override { environment = secrets.environment; }; |
5 | cfg = config.myServices.websites.aten.production; | 5 | cfg = config.myServices.websites.aten.production; |
6 | pcfg = config.services.phpApplication; | 6 | pcfg = config.services.phpApplication; |
@@ -41,10 +41,15 @@ in { | |||
41 | user = config.services.httpd.Prod.user; | 41 | user = config.services.httpd.Prod.user; |
42 | group = config.services.httpd.Prod.group; | 42 | group = config.services.httpd.Prod.group; |
43 | permissions = "0400"; | 43 | permissions = "0400"; |
44 | text = '' | 44 | text = let |
45 | # cf: | ||
46 | # https://secure.php.net/manual/fr/function.parse-url.php | ||
47 | # vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php#parseDatabaseUrlQuery | ||
48 | psql_url = with secrets.postgresql; "pdo-pgsql://${user}:${password}@invalid:${port}/${database}?host=${socket}"; | ||
49 | in '' | ||
45 | SetEnv APP_ENV "${app.environment}" | 50 | SetEnv APP_ENV "${app.environment}" |
46 | SetEnv APP_SECRET "${secrets.secret}" | 51 | SetEnv APP_SECRET "${secrets.secret}" |
47 | SetEnv DATABASE_URL "${secrets.psql_url}" | 52 | SetEnv DATABASE_URL "${psql_url}" |
48 | ''; | 53 | ''; |
49 | }]; | 54 | }]; |
50 | services.websites.env.production.vhostConfs.aten_prod = { | 55 | services.websites.env.production.vhostConfs.aten_prod = { |