m 3 tinc_graphs: merge instead of override nginx config

This commit is contained in:
makefu 2015-10-21 18:47:26 +02:00
parent 506f1c0c38
commit 49b8d341f6

View File

@ -31,6 +31,7 @@ let
}; };
listen = mkOption { listen = mkOption {
# use the type of the nginx listen option
type = with types; listOf str; type = with types; listOf str;
description = "listen address for anonymous graphs"; description = "listen address for anonymous graphs";
default = [ "80" ]; default = [ "80" ];
@ -120,23 +121,23 @@ let
createHome = true; createHome = true;
}; };
krebs.nginx.servers = mkIf cfg.krebsNginx.enable { krebs.nginx.servers = mkIf cfg.nginx.enable {
tinc_graphs_complete = cfg.nginx.complete { tinc_graphs_complete = mkMerge [ cfg.nginx.complete {
locations = [ locations = [
(nameValuePair "/" '' (nameValuePair "/" ''
autoindex on; autoindex on;
root ${internal_dir}; root ${internal_dir};
'') '')
]; ];
}; }] ;
tinc_graphs_anonymous = cfg.nginx.anonymous // { tinc_graphs_anonymous = mkMerge [ cfg.nginx.anonymous {
locations = [ locations = [
(nameValuePair "/" '' (nameValuePair "/" ''
autoindex on; autoindex on;
root ${external_dir}; root ${external_dir};
'') '')
]; ];
}; }];
}; };
}; };