From 043014a7614e641db050354db10907ca39bc3cb4 Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 22 Oct 2022 21:38:12 +0200 Subject: [PATCH] network-homepage: init --- flake.lock | 10 ++++----- flake.nix | 8 +++++++ hosts/network-homepage/default.nix | 32 +++++++++++++++++++++++++++ hosts/public-access-proxy/default.nix | 6 +++++ 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 hosts/network-homepage/default.nix diff --git a/flake.lock b/flake.lock index b365e406..768b86f3 100644 --- a/flake.lock +++ b/flake.lock @@ -934,11 +934,11 @@ ] }, "locked": { - "lastModified": 1664301967, - "narHash": "sha256-VFffgd/XvRtwvOBUG/7HP63MXyuRWQNN+kxn45tJRC8=", - "ref": "refs/heads/master", - "rev": "666e8e44391574a6becda895e90ab336b768cd18", - "revCount": 1624, + "lastModified": 1666466378, + "narHash": "sha256-zZ+ZTjPeII1v2A2zdelDuL+XS2173PJRKhz7Qa7gUVY=", + "ref": "master", + "rev": "8fe58d2816a24bcd31b27556b54011ebcebd01c3", + "revCount": 1630, "type": "git", "url": "https://gitea.c3d2.de/zentralwerk/network.git" }, diff --git a/flake.nix b/flake.nix index 160ed35d..0013de97 100644 --- a/flake.nix +++ b/flake.nix @@ -951,6 +951,14 @@ ./hosts/sshlog ]; }; + + network-homepage = nixosSystem' { + modules = [ + self.nixosModules.microvm + ./hosts/network-homepage + ]; + }; + }; nixosModule = self.nixosModules.c3d2; diff --git a/hosts/network-homepage/default.nix b/hosts/network-homepage/default.nix new file mode 100644 index 00000000..fdcf2285 --- /dev/null +++ b/hosts/network-homepage/default.nix @@ -0,0 +1,32 @@ +{ zentralwerk, config, lib, pkgs, ... }: + +with lib; + +{ + system.stateVersion = "22.05"; + + c3d2.hq.statistics.enable = true; + c3d2.deployment = { + server = "server10"; + mounts = [ "etc" "var"]; + }; + + networking = { + hostName = "network-homepage"; + firewall.allowedTCPPorts = [ 22 80 443 ]; + }; + + services = { + nginx = rec { + enable = true; + virtualHosts."www.zentralwerk.org" = { + forceSSL = true; + enableACME = true; + root = "${zentralwerk.packages.${pkgs.system}.homepage}/share/doc/zentralwerk/www"; + }; + virtualHosts."zentralwerk.org" = virtualHosts."www.zentralwerk.org" // { + default = true; + }; + }; + }; +} diff --git a/hosts/public-access-proxy/default.nix b/hosts/public-access-proxy/default.nix index ec7f8d8b..6db4ab56 100644 --- a/hosts/public-access-proxy/default.nix +++ b/hosts/public-access-proxy/default.nix @@ -89,6 +89,12 @@ "nix-serve.hq.c3d2.de" ]; proxyTo.host = config.c3d2.hosts.hydra.ip4; + } { + hostNames = [ + "zentralwerk.org" + "www.zentralwerk.org" + ]; + proxyTo.host = config.c3d2.hosts.network-homepage.ip4; } { hostNames = [ "kibana.hq.c3d2.de"