From c0c9af04d4e1e77cf50d38fc8af7af12ea22a6ea Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 9 Oct 2019 21:33:37 +0800 Subject: [PATCH] nixbld: add openhardware.hk site --- nixbld-etc-nixos/configuration.nix | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 8dae616..dda037e 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -310,6 +310,9 @@ ACTION=="add", SUBSYSTEM=="tty", \ "chat.m-labs.hk" = null; "hooks.m-labs.hk" = null; "forum.m-labs.hk" = null; + + "openhardware.hk" = null; + "git.openhardware.hk" = null; }; }; }; @@ -439,6 +442,15 @@ ACTION=="add", SUBSYSTEM=="tty", \ include /var/www/flarum/.nginx.conf; ''; }; + + "git.openhardware.hk" = { + forceSSL = true; + useACMEHost = "nixbld.m-labs.hk"; + locations."/".proxyPass = "http://127.0.0.1:3002"; + extraConfig = '' + client_max_body_size 300M; + ''; + }; }; }; services.uwsgi = { @@ -489,6 +501,27 @@ ACTION=="add", SUBSYSTEM=="tty", \ "mail.nmigen.org" = null; }; + containers.openhardwarehk = { + autoStart = true; + config = + { config, pkgs, ... }: + { + services.gitea = { + enable = true; + httpPort = 3002; + rootUrl = "https://git.openhardware.hk/"; + appName = "Open Hardware HK"; + cookieSecure = true; + disableRegistration = true; + extraConfig = + '' + [attachment] + ALLOWED_TYPES = */* + ''; + }; + }; + }; + # This value determines the NixOS release with which your system is to be # compatible, in order to avoid breaking some software such as database # servers. You should change this only after NixOS release notes say you