summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-12-23 09:46:32 +0100
committertv <tv@krebsco.de>2016-12-24 06:52:34 +0100
commit79dec30eaa0257020f7925b014b4208e515f2e6e (patch)
treed882a04b6e5a3ff95f7560d351cd6788d746ff9b
parent6cf60cb0cc3b3b25008acf0ee037e6f101a75e7c (diff)
tv: replace krebs.nginx by services.nginx.virtualHosts
-rw-r--r--tv/2configs/binary-cache/default.nix10
-rw-r--r--tv/2configs/nginx/default.nix12
-rw-r--r--tv/2configs/nginx/public_html.nix14
3 files changed, 17 insertions, 19 deletions
diff --git a/tv/2configs/binary-cache/default.nix b/tv/2configs/binary-cache/default.nix
index 5902f18..39c944b 100644
--- a/tv/2configs/binary-cache/default.nix
+++ b/tv/2configs/binary-cache/default.nix
@@ -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};
- '');
+ '';
};
};
}
diff --git a/tv/2configs/nginx/default.nix b/tv/2configs/nginx/default.nix
index 39995c0..277f459 100644
--- a/tv/2configs/nginx/default.nix
+++ b/tv/2configs/nginx/default.nix
@@ -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";
};
}
diff --git a/tv/2configs/nginx/public_html.nix b/tv/2configs/nginx/public_html.nix
index 4c74d22..9744da1 100644
--- a/tv/2configs/nginx/public_html.nix
+++ b/tv/2configs/nginx/public_html.nix
@@ -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";