1 with import (builtins.fetchTarball {
2 # FIXME: upgrade to nixpkgs 19 when stable and stick to stable
4 name = "nixos-unstable-2018-12-08";
5 url = https://github.com/nixos/nixpkgs/archive/61c3169a0e17d789c566d5b241bfe309ce4a6275.tar.gz;
6 sha256 = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq";
10 webRoot = pkgs.stdenv.mkDerivation rec {
12 name = "adminer-${version}";
14 url = "https://www.adminer.org/static/download/${version}/${name}.php";
15 sha256 = "1qq2g7rbfh2vrqfm3g0bz0qs057b049n0mhabnsbd1sgnpvnc5z7";
17 phases = "installPhase";
20 cp $src $out/index.php
24 socket = "/var/run/phpfpm/adminer.sock";
28 group = ${apache.group}
29 listen.owner = ${apache.user}
30 listen.group = ${apache.group}
33 pm.process_idle_timeout = 60
34 ;php_admin_flag[log_errors] = on
35 php_admin_value[open_basedir] = "${webRoot}:/tmp"
41 modules = [ "proxy_fcgi" ];
43 Alias /adminer ${webRoot}
44 <Directory ${webRoot}>
45 DirectoryIndex = index.php
47 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
56 include ${pkgs.nginx}/conf/fastcgi.conf;
57 fastcgi_split_path_info ^(.+?\.php)(/.*)$;
58 fastcgi_param HTTP_PROXY "";
59 fastcgi_param SCRIPT_FILENAME ${webRoot}/index.php;
60 fastcgi_pass unix:${phpFpm.socket};
61 fastcgi_index index.php;
62 fastcgi_intercept_errors on;
69 webPort = "localhost:18001";
71 host = "malige.home.immae.eu";
77 <LocationMatch "^/mpd">
79 Require ldap-group cn=users,cn=mpd,ou=services,dc=immae,dc=eu
83 RedirectMatch permanent "^/mpd$" "/mpd/"
85 ProxyPass http://${config.webPort}/
86 ProxyPassReverse http://${config.webPort}/
90 ProxyPass ws://${config.webPort}/ws