From b5840e628e60d1614e6e4e04b3ca30f3c7bfacd8 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 18 Sep 2025 06:00:38 +0200 Subject: feat: generate web index for private web UIs --- nixos/hosts/ev/default.nix | 8 +++++++- nixos/hosts/ev/ports.nix | 12 +++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'nixos/hosts/ev') diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix index b0c5ff3..74518f0 100644 --- a/nixos/hosts/ev/default.nix +++ b/nixos/hosts/ev/default.nix @@ -2,10 +2,11 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: let ports = import ./ports.nix; + helpers = import { inherit config lib pkgs; }; in { imports = [ @@ -89,6 +90,11 @@ in ]; networking.firewall.allowedUDPPorts = []; + services.nginx = { + enable = true; + virtualHosts."ev.tailnet" = helpers.serviceIndexHost "ev.tailnet" ports.webUis; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/nixos/hosts/ev/ports.nix b/nixos/hosts/ev/ports.nix index ff5241c..cd41d1b 100644 --- a/nixos/hosts/ev/ports.nix +++ b/nixos/hosts/ev/ports.nix @@ -1,4 +1,4 @@ -{ +rec { grafanaAlloy = 3001; grafanaLoki = 3030; hosehawk = 4000; @@ -6,4 +6,14 @@ prometheusNodeExporter = 9002; qbittorrent = 7777; zigbee2mqtt = 8080; + + webUis = { + inherit + grafanaAlloy + hosehawk + prometheus + qbittorrent + zigbee2mqtt + ; + }; } -- cgit v1.2.3