From 55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 1 Oct 2018 10:26:21 +0200 Subject: Describe custom gitolite and cgit setup Replaces short-term Gitea instance on `code.kummerlaender.eu`. The main reason for implementing this more complex setup is that Gitea both lacks in features in areas that I care about and provides distracting features in other areas that I do not use. e.g. Gitea provides multi-user, discussion and organization support but doesn't provide Atom feeds which are required for [Overview](https://tree.kummerlaender.eu/projects/xslt/overview/). This is why exposing [gitolite](http://gitolite.com)-managed repositories via [cgit](https://git.zx2c4.com/cgit/about/) is a better fit for my usecases. Note that gitolite is further configured outside of Nix through its own admin repository. As a side benefit `pkgs.kummerlaender.eu` now provides further archive formats of its Nix expressions which simplifies Nix channel usage. --- host/software/server/website.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'host/software/server/website.nix') diff --git a/host/software/server/website.nix b/host/software/server/website.nix index c347c25..2e2b9e3 100644 --- a/host/software/server/website.nix +++ b/host/software/server/website.nix @@ -5,19 +5,27 @@ isNormalUser = true; uid = 2000; shell = pkgs.fish; - home = "/home/public"; }; # `public` generates websites using their custom derivations via `nix-build` services.nginx.virtualHosts = let + default = locations: { inherit locations; addSSL = true; enableACME = true; }; + website = sub: default { "/".root = "/home/public/${sub}/result"; }; + + proxy = target: { + proxyPass = target; + extraConfig = '' + proxy_set_header Host code.kummerlaender.eu; + ''; + }; in { "kummerlaender.eu" = website "overview"; "blog.kummerlaender.eu" = website "blog"; @@ -25,8 +33,10 @@ "static.kummerlaender.eu" = website "static"; "pkgs.kummerlaender.eu" = default { - "/".root = "/home/public/pkgs/result"; - "/nixexprs.tar.gz".proxyPass = "http://localhost:3000/adrian/pkgs/archive/master.tar.gz"; + "/".root = "/home/public/pkgs/result"; + "/nixexprs.tar.gz" = proxy "http://code.kummerlaender.eu/pkgs/snapshot/master.tar.gz"; + "/nixexprs.tar.xz" = proxy "http://code.kummerlaender.eu/pkgs/snapshot/master.tar.xz"; + "/nixexprs.tar.bz2" = proxy "http://code.kummerlaender.eu/pkgs/snapshot/master.tar.bz2"; }; }; } -- cgit v1.2.3