tv: replace krebs.nginx by services.nginx.virtualHosts

This commit is contained in:
tv 2016-12-23 09:46:32 +01:00
parent 03689799d6
commit eafa36c2b1
3 changed files with 17 additions and 19 deletions

View File

@ -19,15 +19,15 @@
source-path = toString <secrets> + "/nix-serve.key"; source-path = toString <secrets> + "/nix-serve.key";
}; };
krebs.nginx = { services.nginx = {
enable = true; enable = true;
servers.nix-serve = { virtualHosts.nix-serve = {
server-names = [ serverAliases = [
"cache.${config.krebs.build.host.name}.gg23" "cache.${config.krebs.build.host.name}.gg23"
]; ];
locations = singleton (nameValuePair "/" '' locations."/".extraConfig = ''
proxy_pass http://localhost:${toString config.services.nix-serve.port}; proxy_pass http://localhost:${toString config.services.nix-serve.port};
''); '';
}; };
}; };
} }

View File

@ -3,15 +3,15 @@
with import <stockholm/lib>; with import <stockholm/lib>;
{ {
krebs.nginx = { services.nginx = {
servers.default.locations = [ virtualHosts.default = {
(nameValuePair "= /etc/os-release" '' locations."= /etc/os-release".extraConfig = ''
default_type text/plain; default_type text/plain;
alias /etc/os-release; alias /etc/os-release;
'') '';
]; };
}; };
tv.iptables = optionalAttrs config.krebs.nginx.enable { tv.iptables = {
input-retiolum-accept-tcp = singleton "http"; input-retiolum-accept-tcp = singleton "http";
}; };
} }

View File

@ -3,20 +3,18 @@
with import <stockholm/lib>; with import <stockholm/lib>;
{ {
krebs.nginx = { services.nginx = {
enable = true; enable = true;
servers.default = { virtualHosts.default = {
server-names = [ serverAliases = [
"localhost" "localhost"
"${config.krebs.build.host.name}" "${config.krebs.build.host.name}"
"${config.krebs.build.host.name}.r" "${config.krebs.build.host.name}.r"
"${config.krebs.build.host.name}.retiolum" "${config.krebs.build.host.name}.retiolum"
]; ];
locations = [ locations."~ ^/~(.+?)(/.*)?\$".extraConfig = ''
(nameValuePair "~ ^/~(.+?)(/.*)?\$" '' alias /home/$1/public_html$2;
alias /home/$1/public_html$2; '';
'')
];
}; };
}; };
tv.iptables.input-internet-accept-tcp = singleton "http"; tv.iptables.input-internet-accept-tcp = singleton "http";