From e710e6ed8f6aacb6ab3a839f40d114541919f91a Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 21 Sep 2018 23:22:11 +0200 Subject: Add basic Gogs, NGINX setup for automatix --- host/automatix.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/automatix.nix b/host/automatix.nix index fd819f4..996a96a 100644 --- a/host/automatix.nix +++ b/host/automatix.nix @@ -6,8 +6,50 @@ boot.loader.grub = { enable = true; version = 2; - device = "/dev/sda"; + device = "/dev/sda"; }; - networking.hostName = "automatix"; + networking = { + hostName = "automatix"; + + firewall = { + allowedTCPPorts = [ 22 80 443 ]; + }; + }; + + services = { + gogs = { + enable = true; + database.type = "sqlite3"; + + appName = "~/projects"; + domain = "code.kummerlaender.eu"; + rootUrl = "http://code.kummerlaender.eu/"; + + extraConfig = '' + [service] + DISABLE_REGISTRATION = true + SHOW_REGISTRATION_BUTTON = false + ''; + }; + + nginx = { + enable = true; + + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + + virtualHosts."code.kummerlaender.eu" = { + addSSL = true; + enableACME = true; + locations = { + "/" = { + proxyPass = "http://localhost:3000/"; + }; + }; + }; + }; + }; } -- cgit v1.2.3