diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-12-29 10:40:42 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-12-29 10:40:42 +0100 |
commit | 1bb2ff2cfbffcdc571bc2f8b171ca892c8aebece (patch) | |
tree | defcbad8f49e841a185d21bd5ae541f8e8d76851 /virtual | |
parent | e379fd29ef6e69eb36652043f0ca825bbc00c222 (diff) | |
download | Nix-1bb2ff2cfbffcdc571bc2f8b171ca892c8aebece.tar.gz Nix-1bb2ff2cfbffcdc571bc2f8b171ca892c8aebece.tar.zst Nix-1bb2ff2cfbffcdc571bc2f8b171ca892c8aebece.zip |
Refactor a bit configurations
Diffstat (limited to 'virtual')
-rw-r--r-- | virtual/eldiron.nix | 4 | ||||
-rw-r--r-- | virtual/packages.nix | 35 |
2 files changed, 22 insertions, 17 deletions
diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix index fd72608..c347029 100644 --- a/virtual/eldiron.nix +++ b/virtual/eldiron.nix | |||
@@ -101,7 +101,7 @@ | |||
101 | hostName = "db-1.immae.eu"; | 101 | hostName = "db-1.immae.eu"; |
102 | documentRoot = null; | 102 | documentRoot = null; |
103 | extraConfig = builtins.concatStringsSep "\n" [ | 103 | extraConfig = builtins.concatStringsSep "\n" [ |
104 | mypkgs.adminer.apacheConf | 104 | mypkgs.adminer.apache.vhostConf |
105 | ]; | 105 | ]; |
106 | }) | 106 | }) |
107 | (withSSL "eldiron" // { | 107 | (withSSL "eldiron" // { |
@@ -109,7 +109,7 @@ | |||
109 | hostName = "tools.immae.eu"; | 109 | hostName = "tools.immae.eu"; |
110 | documentRoot = null; | 110 | documentRoot = null; |
111 | extraConfig = builtins.concatStringsSep "\n" [ | 111 | extraConfig = builtins.concatStringsSep "\n" [ |
112 | mypkgs.adminer.apacheConf | 112 | mypkgs.adminer.apache.vhostConf |
113 | ]; | 113 | ]; |
114 | }) | 114 | }) |
115 | { # Should go last, default fallback | 115 | { # Should go last, default fallback |
diff --git a/virtual/packages.nix b/virtual/packages.nix index 2e16a0d..c257dab 100644 --- a/virtual/packages.nix +++ b/virtual/packages.nix | |||
@@ -8,9 +8,10 @@ with import (builtins.fetchTarball { | |||
8 | let | 8 | let |
9 | adminer = rec { | 9 | adminer = rec { |
10 | webRoot = pkgs.stdenv.mkDerivation rec { | 10 | webRoot = pkgs.stdenv.mkDerivation rec { |
11 | name = "adminer-4.7.0"; | 11 | version = "4.7.0"; |
12 | name = "adminer-${version}"; | ||
12 | src = pkgs.fetchurl { | 13 | src = pkgs.fetchurl { |
13 | url = "https://www.adminer.org/static/download/4.7.0/${name}.php"; | 14 | url = "https://www.adminer.org/static/download/${version}/${name}.php"; |
14 | sha256 = "1qq2g7rbfh2vrqfm3g0bz0qs057b049n0mhabnsbd1sgnpvnc5z7"; | 15 | sha256 = "1qq2g7rbfh2vrqfm3g0bz0qs057b049n0mhabnsbd1sgnpvnc5z7"; |
15 | }; | 16 | }; |
16 | phases = "installPhase"; | 17 | phases = "installPhase"; |
@@ -23,10 +24,10 @@ let | |||
23 | socket = "/var/run/phpfpm/adminer.sock"; | 24 | socket = "/var/run/phpfpm/adminer.sock"; |
24 | pool = '' | 25 | pool = '' |
25 | listen = ${socket} | 26 | listen = ${socket} |
26 | user = wwwrun | 27 | user = ${apache.user} |
27 | group = wwwrun | 28 | group = ${apache.group} |
28 | listen.owner = wwwrun | 29 | listen.owner = ${apache.user} |
29 | listen.group = wwwrun | 30 | listen.group = ${apache.group} |
30 | pm = ondemand | 31 | pm = ondemand |
31 | pm.max_children = 5 | 32 | pm.max_children = 5 |
32 | pm.process_idle_timeout = 60 | 33 | pm.process_idle_timeout = 60 |
@@ -34,15 +35,19 @@ let | |||
34 | php_admin_value[open_basedir] = "${webRoot}:/tmp" | 35 | php_admin_value[open_basedir] = "${webRoot}:/tmp" |
35 | ''; | 36 | ''; |
36 | }; | 37 | }; |
37 | apacheConf = '' | 38 | apache = { |
38 | Alias /adminer ${webRoot} | 39 | user = "wwwrun"; |
39 | <Directory ${webRoot}> | 40 | group = "wwwrun"; |
40 | DirectoryIndex = index.php | 41 | vhostConf = '' |
41 | <FilesMatch "\.php$"> | 42 | Alias /adminer ${webRoot} |
42 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | 43 | <Directory ${webRoot}> |
43 | </FilesMatch> | 44 | DirectoryIndex = index.php |
44 | </Directory> | 45 | <FilesMatch "\.php$"> |
45 | ''; | 46 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" |
47 | </FilesMatch> | ||
48 | </Directory> | ||
49 | ''; | ||
50 | }; | ||
46 | nginxConf = { | 51 | nginxConf = { |
47 | alias = webRoot; | 52 | alias = webRoot; |
48 | index = "index.php"; | 53 | index = "index.php"; |