summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-10-20 23:47:29 +0200
committerlassulus <lass@aidsballs.de>2015-10-20 23:47:29 +0200
commitf6187b3796edcfcce71bd239bbc1e793e6bb806a (patch)
tree5e997809616c2d977c5d34bca8b7d8acbd9b7e1a /krebs/3modules
parent281ba78969e0c0233fef0746d42f0ec85179b1bd (diff)
parentfc45cc29265e9b3e51033fddd5d8ea1042c1aa41 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/nginx.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/krebs/3modules/nginx.nix b/krebs/3modules/nginx.nix
index 702e8a7f6..0530921a0 100644
--- a/krebs/3modules/nginx.nix
+++ b/krebs/3modules/nginx.nix
@@ -24,9 +24,21 @@ let
"${config.networking.hostName}.retiolum"
];
};
+ listen = mkOption {
+ 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);
};
+ extraConfig = mkOption {
+ type = with types; str;
+ default = "";
+ };
};
default = {};
};
@@ -60,10 +72,11 @@ let
}
'';
- to-server = { server-names, locations, ... }: ''
+ to-server = { server-names, listen, locations, extraConfig, ... }: ''
server {
- listen 80;
+ ${concatMapStringsSep "\n" (x: "listen ${x};") listen}
server_name ${toString server-names};
+ ${extraConfig}
${indent (concatStrings (map to-location locations))}
}
'';