summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-10-20 19:17:25 +0200
committermakefu <github@syntax-fehler.de>2015-10-20 19:17:25 +0200
commite0eed572ec51e285bf9e874a6b393bbb63b005e6 (patch)
tree8256e49cf578737d9424e893764334f7ea334aad /krebs/3modules
parent24271c6f6b4e730eccb238c28ca4b04eb70ede92 (diff)
parentb2fd7be3ff755e17e9d303f03b9a2345623fd384 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/nginx.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/krebs/3modules/nginx.nix b/krebs/3modules/nginx.nix
index c5f38c271..0530921a0 100644
--- a/krebs/3modules/nginx.nix
+++ b/krebs/3modules/nginx.nix
@@ -25,8 +25,12 @@ let
];
};
listen = mkOption {
- type = with types; str;
+ type = with types; either str (listOf str);
default = "80";
+ apply = x:
+ if typeOf x != "list"
+ then [x]
+ else x;
};
locations = mkOption {
type = with types; listOf (attrsOf str);
@@ -70,7 +74,7 @@ let
to-server = { server-names, listen, locations, extraConfig, ... }: ''
server {
- listen ${listen};
+ ${concatMapStringsSep "\n" (x: "listen ${x};") listen}
server_name ${toString server-names};
${extraConfig}
${indent (concatStrings (map to-location locations))}