summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-12-24 23:38:19 +0100
committermakefu <github@syntax-fehler.de>2016-12-24 23:38:19 +0100
commit3f68cef4b6ac2286767bf9a11bb6e09704986159 (patch)
tree80319ec42bd2f866e19c373f166deb99e4bcfc06 /krebs/3modules
parent1745abde62a68800e065aca8c0d8452ebd005da6 (diff)
k 3 bepasty-server: krebs.nginx -> services.nginx
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/bepasty-server.nix30
1 files changed, 19 insertions, 11 deletions
diff --git a/krebs/3modules/bepasty-server.nix b/krebs/3modules/bepasty-server.nix
index 50e04cf80..73d734237 100644
--- a/krebs/3modules/bepasty-server.nix
+++ b/krebs/3modules/bepasty-server.nix
@@ -22,6 +22,16 @@ let
servers = mkOption {
type = with types; attrsOf optionSet;
+ example = ''
+ {
+ "paste.r" = {
+ defaultPermissions = "read,delete,create";
+ };
+ "paste.krebsco.de" = {
+ defaultPermissions = "read";
+ };
+ }
+ '';
options = singleton {
nginx = mkOption {
# TODO use the correct type
@@ -30,7 +40,6 @@ let
additional nginx configuration. see krebs.nginx for all options
'';
};
-
secretKey = mkOption {
type = types.str;
description = ''
@@ -143,24 +152,23 @@ let
};
nginx-imp = {
- assertions = [{ assertion = config.krebs.nginx.enable;
- message = "krebs.nginx.enable must be true"; }];
+ assertions = [{ assertion = config.services.nginx.enable;
+ message = "services.nginx.enable must be true"; }];
- krebs.nginx.servers = mapAttrs' (name: server:
- nameValuePair("bepasty-server-${name}")
+ services.nginx.virtualHosts = mapAttrs ( server:
(mkMerge [ server.nginx {
extraConfig = ''
client_max_body_size 32M;
'';
- locations = [
- (nameValuePair "/" ''
+ locations = {
+ "/" = ''
proxy_set_header Host $http_host;
proxy_pass http://unix:${server.workDir}/gunicorn-${name}.sock;
- '')
- (nameValuePair "/static/" ''
+ '';
+ "/static/" = ''
alias ${bepasty}/lib/${python.libPrefix}/site-packages/bepasty/static/;
- '')
- ];
+ '';
+ };
}])) cfg.servers ;
};
in