summaryrefslogtreecommitdiff
path: root/host/software/server/website.nix
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-10-01 10:26:21 +0200
committerAdrian Kummerlaender2018-10-01 10:53:35 +0200
commit55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514 (patch)
tree601dede9bb5acc9c709924653e9ca8129c4a0162 /host/software/server/website.nix
parent17864d7ca574a0519fc4e8bb592796ede1221812 (diff)
downloadnixos_system-55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514.tar
nixos_system-55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514.tar.gz
nixos_system-55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514.tar.bz2
nixos_system-55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514.tar.xz
nixos_system-55daf8a35f4f1761f5f4c4ebe4a6dcb4b0ace514.zip
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.
Diffstat (limited to 'host/software/server/website.nix')
-rw-r--r--host/software/server/website.nix16
1 files changed, 13 insertions, 3 deletions
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";
};
};
}