From 6a408db9c1e6bf3162f9fad19aec61bb440d2d90 Mon Sep 17 00:00:00 2001 From: schweby Date: Fri, 25 Jun 2021 11:38:47 +0200 Subject: [PATCH] hotfix: add websites to hainich because gitlab broke websites AGAIN, they are now running on hainich directly While this is only a temporary solution, I think it will be as permanent as they come --- hosts/hainich/configuration.nix | 1 + hosts/hainich/services/websites.nix | 43 +++++++++++++++++++++++++++++ nix/sources.json | 12 ++++++++ 3 files changed, 56 insertions(+) create mode 100644 hosts/hainich/services/websites.nix diff --git a/hosts/hainich/configuration.nix b/hosts/hainich/configuration.nix index b36b0ab..634e219 100644 --- a/hosts/hainich/configuration.nix +++ b/hosts/hainich/configuration.nix @@ -12,6 +12,7 @@ ../../common # ./wireguard.nix ./services/nginx.nix + ./services/websites.nix # ./k8s.nix ./services/ghost_waszumfff.nix ./services/gitlab-runner.nix diff --git a/hosts/hainich/services/websites.nix b/hosts/hainich/services/websites.nix new file mode 100644 index 0000000..a2b0f1c --- /dev/null +++ b/hosts/hainich/services/websites.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +let + sources = import ../../../nix/sources.nix; +in + +let + haccearth = pkgs.stdenv.mkDerivation { + name = "hacc.earth-website"; + src = sources.haccearth-website.outPath.outPath; + buildPhase = '' + ${pkgs.jekyll.outPath}/bin/jekyll build + ''; + installPhase = '' + mkdir -p $out + cp -r _site/* $out + ''; + }; + infra4futurede = pkgs.stdenv.mkDerivation { + name = "infra4future.de-website"; + src = sources.infra4future-website.outPath.outPath; + buildPhase = '' + ${pkgs.jekyll.outPath}/bin/jekyll build + ''; + installPhase = '' + mkdir -p $out + cp -r _site/* $out + ''; + }; +in +{ + services.nginx.virtualHosts."hacc.earth" = { + forceSSL = true; + enableACME = true; + root = haccearth.outPath; + }; + + services.nginx.virtualHosts."infra4future.de" = { + forceSSL = true; + enableACME = true; + root = infra4futurede.outPath; + }; +} diff --git a/nix/sources.json b/nix/sources.json index ad0985c..dcded66 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -37,6 +37,18 @@ "url_template": "https://releases.mattermost.com//mattermost--linux-amd64.tar.gz", "version": "5.34.3" }, + "haccearth-website": { + "branch": "master", + "repo": "https://gitlab.infra4future.de/hacc/infra4future/hacc.earth.git", + "rev": "1a79b7468f156a3bb2da1c4c810d7db9e86fdb9f", + "type": "git" + }, + "infra4future-website": { + "branch": "master", + "repo": "https://gitlab.infra4future.de/hacc/infra4future/infra4future.de.git", + "rev": "7520f0c343f33dbdb385df15cd3fbcde79d734c4", + "type": "git" + }, "mumble-website": { "branch": "master", "repo": "https://gitlab.infra4future.de/hacc/infra4future/mumble.infra4future.de.git",