1
0
mirror of https://github.com/kmein/niveum synced 2026-03-19 03:21:10 +01:00

feat: add serveHtml helper

This commit is contained in:
2021-10-11 20:02:17 +02:00
parent f6ffd477d1
commit 2384a4eef5
3 changed files with 11 additions and 18 deletions

View File

@@ -1,11 +1,12 @@
{ pkgs, lib, ... }:
let
inherit (import <niveum/lib>) serveHtml;
stations = [
900068204 # A/M
900068302 # KAS
900068203 # B-P
];
fahrplanHtml = ''
fahrplan = pkgs.writeText "fahrplan.html" ''
<!DOCTYPE html>
<title>Fahrplan</title>
<link
@@ -51,10 +52,6 @@ in
};
services.nginx.virtualHosts."bvg.kmein.r" = {
locations."/".extraConfig = ''
default_type "text/html";
root ${pkgs.linkFarm "fahrplan" [{ name = "index.html"; path = pkgs.writeText "fahrplan.html" fahrplanHtml; }]};
index index.html;
'';
locations."/".extraConfig = serveHtml fahrplan pkgs;
};
}