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 --- conf/common.nix | 3 +-- host/automatix.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/conf/common.nix b/conf/common.nix index d1c4ba1..ade26d3 100644 --- a/conf/common.nix +++ b/conf/common.nix @@ -9,8 +9,7 @@ openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDy2h3NXWVW7BlEehCCgQ3ZMq64rqxoI70dg9Zq3SdIWcqunkWsHGSmzXbxM0ZCD2/VWNVrvShusg0dDSOwV64HUxIuDWpM6gCvg5MKBS0ZMwb9831d0ybf6kU/gppJGyM7R9HspB69C9pnKBB6vUUXd/TgmjhiAHPCwbq/vgWRN7yYGwB/tc7pRiugk6tyfgvXvFCnQXZLoPSx0qBF3L6YyRzbtL5sI7KoN/gCzgqnT0H91vhxkjXrPN+GnW43lcbaqApd3gd0NmMaWNxR6ZKnXFFcUPI72cbBmhe3+t15pF9ZUYZ0sKSfbgOZx0vHLiS69Dr63L6gVNGNx7B/yxC3 common@asterix" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCdvxfprSTiMGKeH3GvG9/gupBM0urKTrliK2wzrgcHgNyWiaGFveRpX4cMPdi8uhfDrwGmKLYJfAfjsmmpmY8DTDpkeXT2vdS7q0YtoYCgjztXum0Fxd4khR3Z4Pwh6BEpxBgzIE94T749wuvW2gZLyHGPyZH5w3EXr4TBh4YSwUwVYGrPaGDVbsJ/8lEpqPu5T4S1CzaaLh0mfuyIJfo0EfU8TWmA028qVfz+6jT3/CZrv0Ru/HYEo6mAY35Im3pGTug7GWLI45tbaI++jJCo7dK+rs3uPyccHxLHnUwPtxj4wVGBbcVy8S5LyJpm2lFHQO4eu4QHiFgBA2GeXCF common@obelix" - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCg5H5dtZwtKltCjCbQ2wDsMMNb3X7wcpiPpH+QBIdhMcDeyiEy5HoD6yVKppIJA9KQKr7VjzCF0eV/PgBVyoKZGGPSfB1B1Diys6MYCBSgfYh7iqxzyzdOl4/NTGsHEN6iH9e86QBge5VcUaIf/2H/g4F+5/mekR3h6aDqkS596pk3PzSiuWIZN1OCaTILG0QakQ24oevlHloasG2oWdR+Bfjp3kFvDbX5yVPPSBCLwCnyZPWse+MYAD+HAw70pve7InO35s/VyodC8RODiHZ6sQAK+o1Y9g1UDE1aTXhXWBNt1wQVIlYd9+Bf4lWuB0FA5kUfXd4Li5O4RWW3fsKT common@Schreibfix" + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKzc+VocgNSTXa64vwYeydjhKJRWMMZcQ1tmDv/uWbAhB9lDwS1b5R868u0gHbpRCfR6xFBFM0IYxS61RZktH0Cc0d3TU4xxX0oa84LN70LsQut/WiT38zTEWCltz+2+RgS1TuDTqhnp/S7fHc8Bm8oNsI8f25K9EqEADVtxzjxhiz7US6U6GbhoSx2/3hDUp4IgZU/MsDVCqQ0T1SMJIZS8vM2EUpeVZNhIuYJ06Ncy8MAgG1sEacXd+rb96Yltd7+y9QK+5aIYYs4Sx3Y6rXKmUj/mLWIroFY4jSk3Mw81+60px+qDhwY4kJv1Ttfs14awaZ5JRHO5fDPhwfrcTt common@Schreibfix" ]; }; } 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