Merge pull request #2976 from bluescreen303/nginx

nginx: fix group, statedir permissions, add echo module, fix aio

lethalman 219e9925 6025caa9

+24 -13
+2 -3
nixos/modules/services/web-servers/nginx/default.nix
··· 84 }; 85 86 config = mkIf cfg.enable { 87 - environment.systemPackages = [ nginx ]; 88 - 89 # TODO: test user supplied config file pases syntax test 90 91 systemd.services.nginx = { ··· 96 preStart = 97 '' 98 mkdir -p ${cfg.stateDir}/logs 99 chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir} 100 ''; 101 serviceConfig = { ··· 105 106 users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton 107 { name = "nginx"; 108 - group = "nginx"; 109 uid = config.ids.uids.nginx; 110 }); 111
··· 84 }; 85 86 config = mkIf cfg.enable { 87 # TODO: test user supplied config file pases syntax test 88 89 systemd.services.nginx = { ··· 94 preStart = 95 '' 96 mkdir -p ${cfg.stateDir}/logs 97 + chmod 700 ${cfg.stateDir} 98 chown -R ${cfg.user}:${cfg.group} ${cfg.stateDir} 99 ''; 100 serviceConfig = { ··· 104 105 users.extraUsers = optionalAttrs (cfg.user == "nginx") (singleton 106 { name = "nginx"; 107 + group = cfg.group; 108 uid = config.ids.uids.nginx; 109 }); 110
+22 -10
pkgs/servers/http/nginx/default.nix
··· 3 , rtmp ? false 4 , fullWebDAV ? false 5 , syslog ? false 6 - , moreheaders ? false}: 7 8 let 9 version = "1.6.0"; ··· 35 rev = "0c6e05d3125a97892a250e9ba8b7674163ba500b"; 36 sha256 = "e121d97fd3c81c64e6cbf6902bbcbdb01be9ac985c6832d40434379d5e998eaf"; 37 }; 38 in 39 40 stdenv.mkDerivation rec { ··· 43 44 buildInputs = 45 [ openssl zlib pcre libxml2 libxslt gd geoip 46 - ] ++ stdenv.lib.optional fullWebDAV expat; 47 48 patches = if syslog then [ "${syslog-ext}/syslog-1.5.6.patch" ] else []; 49 ··· 69 "--with-ipv6" 70 # Install destination problems 71 # "--with-http_perl_module" 72 - ] ++ stdenv.lib.optional rtmp "--add-module=${rtmp-ext}" 73 - ++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}" 74 - ++ stdenv.lib.optional syslog "--add-module=${syslog-ext}" 75 - ++ stdenv.lib.optional moreheaders "--add-module=${moreheaders-ext}"; 76 77 - additionalFlags = stdenv.lib.optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; 78 79 preConfigure = '' 80 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags" ··· 87 meta = { 88 description = "A reverse proxy and lightweight webserver"; 89 homepage = http://nginx.org; 90 - license = stdenv.lib.licenses.bsd2; 91 - platforms = stdenv.lib.platforms.all; 92 - maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ]; 93 }; 94 }
··· 3 , rtmp ? false 4 , fullWebDAV ? false 5 , syslog ? false 6 + , moreheaders ? false 7 + , echo ? false }: 8 + 9 + with stdenv.lib; 10 11 let 12 version = "1.6.0"; ··· 38 rev = "0c6e05d3125a97892a250e9ba8b7674163ba500b"; 39 sha256 = "e121d97fd3c81c64e6cbf6902bbcbdb01be9ac985c6832d40434379d5e998eaf"; 40 }; 41 + 42 + echo-ext = fetchgit { 43 + url = https://github.com/openresty/echo-nginx-module.git; 44 + rev = "refs/tags/v0.53"; 45 + sha256 = "90d4e3a49c678019f4f335bc18529aa108fcc9cfe0747ea4e2f6084a70da2868"; 46 + }; 47 in 48 49 stdenv.mkDerivation rec { ··· 52 53 buildInputs = 54 [ openssl zlib pcre libxml2 libxslt gd geoip 55 + ] ++ optional fullWebDAV expat; 56 57 patches = if syslog then [ "${syslog-ext}/syslog-1.5.6.patch" ] else []; 58 ··· 78 "--with-ipv6" 79 # Install destination problems 80 # "--with-http_perl_module" 81 + ] ++ optional rtmp "--add-module=${rtmp-ext}" 82 + ++ optional fullWebDAV "--add-module=${dav-ext}" 83 + ++ optional syslog "--add-module=${syslog-ext}" 84 + ++ optional moreheaders "--add-module=${moreheaders-ext}" 85 + ++ optional echo "--add-module=${echo-ext}" 86 + ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"; 87 + 88 89 + additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations"; 90 91 preConfigure = '' 92 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags" ··· 99 meta = { 100 description = "A reverse proxy and lightweight webserver"; 101 homepage = http://nginx.org; 102 + license = licenses.bsd2; 103 + platforms = platforms.all; 104 + maintainers = with maintainers; [ thoughtpolice raskin ]; 105 }; 106 }