diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 12:41:23 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-01-12 21:59:41 +0100 |
commit | 108891744eaa7410e305871212d5b81c1b67a095 (patch) | |
tree | 90e3f1a87573532ed1c14e233ad7348904ce47f8 /virtual/packages/adminer.nix | |
parent | 950ca5ee979ae2467f3471216140de2c1d572f4b (diff) | |
download | Nix-108891744eaa7410e305871212d5b81c1b67a095.tar.gz Nix-108891744eaa7410e305871212d5b81c1b67a095.tar.zst Nix-108891744eaa7410e305871212d5b81c1b67a095.zip |
Refactor websites.
This commit refactors websites into module per "vhost".
Diffstat (limited to 'virtual/packages/adminer.nix')
-rw-r--r-- | virtual/packages/adminer.nix | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/virtual/packages/adminer.nix b/virtual/packages/adminer.nix deleted file mode 100644 index 7094e45..0000000 --- a/virtual/packages/adminer.nix +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | { stdenv, fetchurl, nginx }: | ||
2 | let | ||
3 | adminer = rec { | ||
4 | webRoot = stdenv.mkDerivation rec { | ||
5 | version = "4.7.0"; | ||
6 | name = "adminer-${version}"; | ||
7 | src = fetchurl { | ||
8 | url = "https://www.adminer.org/static/download/${version}/${name}.php"; | ||
9 | sha256 = "1qq2g7rbfh2vrqfm3g0bz0qs057b049n0mhabnsbd1sgnpvnc5z7"; | ||
10 | }; | ||
11 | phases = "installPhase"; | ||
12 | installPhase = '' | ||
13 | mkdir -p $out | ||
14 | cp $src $out/index.php | ||
15 | ''; | ||
16 | }; | ||
17 | phpFpm = rec { | ||
18 | socket = "/var/run/phpfpm/adminer.sock"; | ||
19 | pool = '' | ||
20 | listen = ${socket} | ||
21 | user = ${apache.user} | ||
22 | group = ${apache.group} | ||
23 | listen.owner = ${apache.user} | ||
24 | listen.group = ${apache.group} | ||
25 | pm = ondemand | ||
26 | pm.max_children = 5 | ||
27 | pm.process_idle_timeout = 60 | ||
28 | ;php_admin_flag[log_errors] = on | ||
29 | ; Needed to avoid clashes in browser cookies (same domain) | ||
30 | php_value[session.name] = AdminerPHPSESSID | ||
31 | php_admin_value[open_basedir] = "${webRoot}:/tmp" | ||
32 | php_admin_value[session.save_path] = "/var/lib/php/sessions/adminer" | ||
33 | ''; | ||
34 | }; | ||
35 | apache = { | ||
36 | user = "wwwrun"; | ||
37 | group = "wwwrun"; | ||
38 | modules = [ "proxy_fcgi" ]; | ||
39 | vhostConf = '' | ||
40 | Alias /adminer ${webRoot} | ||
41 | <Directory ${webRoot}> | ||
42 | DirectoryIndex index.php | ||
43 | <FilesMatch "\.php$"> | ||
44 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | ||
45 | </FilesMatch> | ||
46 | </Directory> | ||
47 | ''; | ||
48 | }; | ||
49 | nginxConf = { | ||
50 | alias = webRoot; | ||
51 | index = "index.php"; | ||
52 | extraConfig = '' | ||
53 | include ${nginx}/conf/fastcgi.conf; | ||
54 | fastcgi_split_path_info ^(.+?\.php)(/.*)$; | ||
55 | fastcgi_param HTTP_PROXY ""; | ||
56 | fastcgi_param SCRIPT_FILENAME ${webRoot}/index.php; | ||
57 | fastcgi_pass unix:${phpFpm.socket}; | ||
58 | fastcgi_index index.php; | ||
59 | fastcgi_intercept_errors on; | ||
60 | ''; | ||
61 | }; | ||
62 | }; | ||
63 | in | ||
64 | adminer | ||