Fix accidental use of mkMerge not recursiveUpdate
Change-Id: I61858bc2d758d616e1a6d45ee5b49c8e87b28da0
diff --git a/nginx.nix b/nginx.nix
index 16ef120..316a294 100644
--- a/nginx.nix
+++ b/nginx.nix
@@ -76,7 +76,7 @@
_merge = service: currentConfig: currentPath: secure: priority:
if service.type == "hosts"
- then _merge service.service (lib.mkMerge currentConfig {
+ then _merge service.service (lib.recursiveUpdate currentConfig {
name = service.host;
value = {
serverAliases = service.extraHosts;
@@ -93,7 +93,7 @@
};
}) currentPath service.secure priority
else if service.type == "reverseproxy"
- then (lib.mkMerge currentConfig {
+ then (lib.recursiveUpdate currentConfig {
value.locations.${currentPath} = {
proxyPass = service.to;
proxyWebsockets = true;
@@ -101,7 +101,7 @@
};
})
else if service.type == "php"
- then (lib.mkMerge currentConfig {
+ then (lib.recursiveUpdate currentConfig {
value.locations.${currentPath} = {
root = service.root;
index = "index.php index.html index.htm";
@@ -120,14 +120,14 @@
};
})
else if service.type == "redirect"
- then (lib.mkMerge currentConfig {
+ then (lib.recursiveUpdate currentConfig {
value.locations.${currentPath}.return =
if service.permanent
then "308 ${service.to}"
else "307 ${service.to}";
})
else if service.type == "directory"
- then (lib.mkMerge currentConfig {
+ then (lib.recursiveUpdate currentConfig {
value.locations.${currentPath} = {
root = service.root;
index = "index.html index.htm";
@@ -136,7 +136,7 @@
};
})
else if service.type == "file"
- then (lib.mkMerge currentConfig {
+ then (lib.recursiveUpdate currentConfig {
value.locations.${currentPath} = {
tryFiles = "${service.path} =404";
};