summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/nginx.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/3modules/nginx.nix')
-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 702e8a7f..0530921a 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))}
}
'';