refactor(web): Let //web/ derivations build static pages only

Removes nginx configuration built by the web targets (with the
exception of the includable block used to set up redirects for old
blog URLs).
This commit is contained in:
Vincent Ambo 2020-02-11 19:31:20 +00:00
parent 2e95822712
commit b5c50f4699
3 changed files with 14 additions and 93 deletions

View file

@ -7,7 +7,7 @@
with pkgs.nix.yants;
let
inherit (builtins) filter;
inherit (builtins) filter hasAttr map;
# Type definition for a single blog post.
post = struct "blog-post" {
@ -48,4 +48,12 @@ in {
# Only include listed posts
posts = filter includePost posts;
# Generate embeddable nginx configuration for redirects from old post URLs
oldRedirects = lib.concatStringsSep "\n" (map (post: ''
location ~* ^(/en)?/${post.oldKey} {
# TODO(tazjin): 301 once this works
return 302 https://tazj.in/blog/${post.key};
}
'') (filter (hasAttr "oldKey") posts));
}