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