diff options
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/3modules/nginx.nix | 8 |
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))} |