diff options
author | Vincent Ambo <mail@tazj.in> | 2020-06-12T02·02+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2020-06-12T02·17+0000 |
commit | a9f3621fd781e88b8bb914b0daf0b06c147f0cd0 (patch) | |
tree | 197def3401be3609ecead1768690c357c65131b4 /ops/nixos | |
parent | 7bad1fe852bb0a6f2661240e1e2842662c3d7e85 (diff) |
feat(camden): Move hound to cs.tvl.fyi r/920
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>
Diffstat (limited to '')
-rw-r--r-- | ops/nixos/camden/default.nix | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix index df1520a767b2..ea8f0f5ad25b 100644 --- a/ops/nixos/camden/default.nix +++ b/ops/nixos/camden/default.nix @@ -5,6 +5,14 @@ config: let nixpkgs = import depot.third_party.nixpkgsSrc { config.allowUnfree = true; }; + + nginxRedirect = { from, to, acmeHost }: { + serverName = from; + useACMEHost = acmeHost; + forceSSL = true; + + extraConfig = "return 301 https://${to}$request_uri;"; + }; in lib.fix(self: { imports = [ ../modules/depot.nix @@ -222,7 +230,6 @@ in lib.fix(self: { # Local domains (for this machine only) "camden.tazj.in" = null; - "git.camden.tazj.in" = null; }; 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 = { - serverName = "cs.tazj.in"; - useACMEHost = "tazj.in"; + serverName = "cs.tvl.fyi"; + useACMEHost = "tvl.fyi"; forceSSL = true; 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. |