feat(camden): Move hound to cs.tvl.fyi

The old host at cs.tazj.in now redirects there, and I've added a
helper function for creating these redirections.

Change-Id: I66794d752df46c8e795e47aedfaffd8c27c45627
Reviewed-on: https://cl.tvl.fyi/c/depot/+/89
Reviewed-by: riking <rikingcoding@gmail.com>
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Vincent Ambo 2020-06-12 03:02:18 +01:00 committed by tazjin
parent 7bad1fe852
commit a9f3621fd7

View file

@ -5,6 +5,14 @@ config: let
nixpkgs = import depot.third_party.nixpkgsSrc { nixpkgs = import depot.third_party.nixpkgsSrc {
config.allowUnfree = true; config.allowUnfree = true;
}; };
nginxRedirect = { from, to, acmeHost }: {
serverName = from;
useACMEHost = acmeHost;
forceSSL = true;
extraConfig = "return 301 https://${to}$request_uri;";
};
in lib.fix(self: { in lib.fix(self: {
imports = [ imports = [
../modules/depot.nix ../modules/depot.nix
@ -222,7 +230,6 @@ in lib.fix(self: {
# Local domains (for this machine only) # Local domains (for this machine only)
"camden.tazj.in" = null; "camden.tazj.in" = null;
"git.camden.tazj.in" = null;
}; };
postRun = "systemctl reload nginx"; postRun = "systemctl reload nginx";
}; };
@ -392,19 +399,9 @@ in lib.fix(self: {
''; '';
}; };
virtualHosts.cgit-old = {
serverName = "git.tazj.in";
useACMEHost = "tazj.in";
forceSSL = true;
extraConfig = ''
return 301 https://code.tvl.fyi$request_uri;
'';
};
virtualHosts.hound = { virtualHosts.hound = {
serverName = "cs.tazj.in"; serverName = "cs.tvl.fyi";
useACMEHost = "tazj.in"; useACMEHost = "tvl.fyi";
forceSSL = true; forceSSL = true;
extraConfig = '' extraConfig = ''
@ -427,6 +424,18 @@ in lib.fix(self: {
} }
''; '';
}; };
virtualHosts.cgit-old = nginxRedirect {
from = "git.tazj.in";
to = "code.tvl.fyi";
acmeHost = "tazj.in";
};
virtualHosts.cs-old = nginxRedirect {
from = "cs.tazj.in";
to = "cs.tvl.fyi";
acmeHost = "tazj.in";
};
}; };
# Timer units that can be started with systemd-run to set my alarm. # Timer units that can be started with systemd-run to set my alarm.