k 3 tinc_graphs: krebs.nginx -> services.nginx
This commit is contained in:
parent
3f68cef4b6
commit
d3765adcaf
|
@ -35,35 +35,28 @@ let
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = mkEnableOption "enable tinc_graphs to be served with nginx";
|
enable = mkEnableOption "enable tinc_graphs to be served with nginx";
|
||||||
|
|
||||||
anonymous = {
|
anonymous = mkOption {
|
||||||
server-names = mkOption {
|
type = types.attrsOf types.unspecified;
|
||||||
type = with types; listOf str;
|
description = ''
|
||||||
description = "hostnames which serve anonymous graphs";
|
nginx virtualHost options to be merged into the anonymous graphs
|
||||||
default = [ "graphs.${config.krebs.build.host.name}" ];
|
vhost entry.
|
||||||
};
|
'';
|
||||||
|
};
|
||||||
listen = mkOption {
|
anonymous-domain = mkOption {
|
||||||
# use the type of the nginx listen option
|
type = types.str;
|
||||||
type = with types; listOf str;
|
description = ''
|
||||||
description = "listen address for anonymous graphs";
|
external domainname to be used for anonymous graphs
|
||||||
default = [ "80" ];
|
it will be used if you want to enable ACME
|
||||||
};
|
'';
|
||||||
|
default = "graphs.krebsco.de";
|
||||||
};
|
};
|
||||||
|
|
||||||
complete = {
|
complete = mkOption {
|
||||||
server-names = mkOption {
|
type = types.attrsOf types.unspecified;
|
||||||
type = with types; listOf str;
|
description = ''
|
||||||
description = "hostname which serves complete graphs";
|
nginx virtualHost options to be merged into the complete graphs
|
||||||
default = [ "graphs.${config.krebs.build.host.name}" ];
|
vhost entry.
|
||||||
};
|
'';
|
||||||
|
|
||||||
listen = mkOption {
|
|
||||||
type = with types; listOf str;
|
|
||||||
description = "listen address for complete graphs";
|
|
||||||
default = [ "127.0.0.1:80" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -134,24 +127,20 @@ let
|
||||||
uid = genid "tinc_graphs";
|
uid = genid "tinc_graphs";
|
||||||
home = "/var/spool/tinc_graphs";
|
home = "/var/spool/tinc_graphs";
|
||||||
};
|
};
|
||||||
krebs.nginx = mkIf cfg.nginx.enable {
|
services.nginx = mkIf cfg.nginx.enable {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
servers = {
|
virtualHosts = {
|
||||||
tinc_graphs_complete = mkMerge [ cfg.nginx.complete {
|
tinc_graphs_complete = mkMerge [ cfg.nginx.complete {
|
||||||
locations = [
|
locations = {
|
||||||
(nameValuePair "/" ''
|
"/".extraConfig = "autoindex on;";
|
||||||
autoindex on;
|
"/".root = internal_dir;
|
||||||
root ${internal_dir};
|
};
|
||||||
'')
|
}];
|
||||||
];
|
"${cfg.nginx.anonymous-domain}" = mkMerge [ cfg.nginx.anonymous {
|
||||||
}] ;
|
locations = {
|
||||||
tinc_graphs_anonymous = mkMerge [ cfg.nginx.anonymous {
|
"/".extraConfig = "autoindex on;";
|
||||||
locations = [
|
"/".root = external_dir;
|
||||||
(nameValuePair "/" ''
|
};
|
||||||
autoindex on;
|
|
||||||
root ${external_dir};
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user