From 62d361834f8cbee91a5ff85e1f534ea449673a72 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sun, 24 Aug 2025 00:02:38 -0500 Subject: [PATCH] use static index --- homelab-services/nimh-static/index.html | 22 ++++++++++++++++++++++ nixos/configuration.nix | 16 +++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/homelab-services/nimh-static/index.html b/homelab-services/nimh-static/index.html index e69de29..d33d2fb 100644 --- a/homelab-services/nimh-static/index.html +++ b/homelab-services/nimh-static/index.html @@ -0,0 +1,22 @@ + + + + + NIMH Static Test + + + +

Welcome to nimh.roypository.com!

+

This is a barebones static site served via Nginx on NixOS.

+ + + diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f5b12d1..8f96da2 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -1,5 +1,11 @@ { config, lib, pkgs, meta, ... }: +let + nimhStaticSite = pkgs.runCommand "nimh-static-site" { } '' + mkdir -p $out + cp -r ${../homelab-services/nimh-static}/* $out/ + ''; +in { imports = [ ]; @@ -70,6 +76,8 @@ }; }; + + # Setup vhosts via nginx services.nginx = { enable = true; @@ -86,7 +94,13 @@ forceSSL = true; useACMEHost = "roypository.com"; - locations = { }; + locations."/" = { + root = nimhStaticSite; + index = "index.html"; + extraConfig = '' + autoindex off; + ''; + }; }; };