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";
};
krebs.nginx = {
services.nginx = {
enable = true;
servers.nix-serve = {
server-names = [
virtualHosts.nix-serve = {
serverAliases = [
"cache.${config.krebs.build.host.name}.gg23"
];
locations = singleton (nameValuePair "/" ''
locations."/".extraConfig = ''
proxy_pass http://localhost:${toString config.services.nix-serve.port};
'');
'';
};
};
}

View File

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

View File

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