aboutsummaryrefslogtreecommitdiff
path: root/modules/apps
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2016-12-20 14:30:05 +0300
committerIgor Pashev <pashev.igor@gmail.com>2016-12-20 14:30:05 +0300
commitae37f7b55f5a6b8c5fef7236530e58e45613d4a6 (patch)
tree48b0d64e33f057a5b930524d9ae7ea60f4a9e743 /modules/apps
parentccba01b511f5275370a16d71d237f8bfa8fcd20c (diff)
downloadnixsap-ae37f7b55f5a6b8c5fef7236530e58e45613d4a6.tar.gz
nginx: refactored config
events -> conf.events http -> conf.http main -> conf
Diffstat (limited to 'modules/apps')
-rw-r--r--modules/apps/icingaweb2.nix2
-rw-r--r--modules/apps/mediawiki/default.nix2
-rw-r--r--modules/apps/nginx.nix32
3 files changed, 18 insertions, 18 deletions
diff --git a/modules/apps/icingaweb2.nix b/modules/apps/icingaweb2.nix
index d8397ec..852c546 100644
--- a/modules/apps/icingaweb2.nix
+++ b/modules/apps/icingaweb2.nix
@@ -370,7 +370,7 @@ in {
pool = recursiveUpdate defaultPool (cfg.php-fpm.pool // { user = cfg.user ;});
};
- nixsap.apps.nginx.http.servers.icingaweb2 = ''
+ nixsap.apps.nginx.conf.http.servers.icingaweb2 = ''
${cfg.nginxServer}
root ${pkgs.icingaweb2}/public;
diff --git a/modules/apps/mediawiki/default.nix b/modules/apps/mediawiki/default.nix
index 681b76e..2988f07 100644
--- a/modules/apps/mediawiki/default.nix
+++ b/modules/apps/mediawiki/default.nix
@@ -304,7 +304,7 @@ in {
pool = recursiveUpdate defaultPool (cfg.php-fpm.pool // { user = cfg.user ;});
};
- nixsap.apps.nginx.http.servers.mediawiki = nginx;
+ nixsap.apps.nginx.conf.http.servers.mediawiki = nginx;
systemd.services.mediawiki-db = {
description = "configure Mediawiki database";
diff --git a/modules/apps/nginx.nix b/modules/apps/nginx.nix
index ce1695a..3490a4b 100644
--- a/modules/apps/nginx.nix
+++ b/modules/apps/nginx.nix
@@ -40,10 +40,10 @@ let
user ${cfg.user} ${cfg.user};
pid ${cfg.runDir}/nginx.pid;
- ${format "" cfg.main}
+ ${format "" (filterAttrs (n: _: ! elem n ["events" "http"]) cfg.conf)}
events {
- ${format " " cfg.events}
+ ${format " " cfg.conf.events}
}
http {
@@ -66,7 +66,7 @@ let
fastcgi_param HTTP_PROXY "";
proxy_set_header Proxy "";
- ${concatMapStrings (s: "include ${s};\n") (mapAttrsToList mkServer cfg.http.servers)}
+ ${concatMapStrings (s: "include ${s};\n") (mapAttrsToList mkServer cfg.conf.http.servers)}
}
'';
@@ -97,7 +97,7 @@ in {
default = "/run/nginx";
};
- main = default {} (attrs {
+ conf = default {} (attrs {
pcre_jit = optional bool;
timer_resolution = optional int;
worker_cpu_affinity = optional str;
@@ -105,22 +105,22 @@ in {
worker_processes = default "auto" (either int (enum ["auto"]));
worker_rlimit_core = optional int;
worker_rlimit_nofile = optional int;
- });
-
- events = default {} (attrs {
- accept_mutex = optional bool;
- accept_mutex_delay = optional int;
- multi_accept = optional bool;
- worker_aio_requests = optional int;
- worker_connections = optional int;
- });
- http = default {} (attrs {
- servers = default {} (attrsOf lines);
+ events = default {} (attrs {
+ accept_mutex = optional bool;
+ accept_mutex_delay = optional int;
+ multi_accept = optional bool;
+ worker_aio_requests = optional int;
+ worker_connections = optional int;
+ });
+
+ http = default {} (attrs {
+ servers = default {} (attrsOf lines);
+ });
});
};
- config = mkIf ({} != explicit cfg.http.servers) {
+ config = mkIf ({} != explicit cfg.conf.http.servers) {
nixsap.system.users.daemons = [ cfg.user ];
systemd.services.nginx = {
description = "web/proxy server";