From ef37c7f8495b5e14325488197736692b0fe60b48 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 5 Nov 2025 23:16:18 -0500 Subject: [PATCH] Setup littlelink site --- .../nixos/hetznix02/post-install/nginx.nix | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/hosts/nixos/hetznix02/post-install/nginx.nix b/modules/hosts/nixos/hetznix02/post-install/nginx.nix index 6c8a9f0..9b2fec3 100644 --- a/modules/hosts/nixos/hetznix02/post-install/nginx.nix +++ b/modules/hosts/nixos/hetznix02/post-install/nginx.nix @@ -1,9 +1,20 @@ -{ config, ... }: let +{ config, pkgs, ... }: let domain = "genebean.me"; http_port = 80; https_port = 443; in { + environment.etc.nginx-littlelinks = { + # Info generated via + # nurl https://github.com/genebean/littlelink genebean-sometag + source = pkgs.fetchFromGitHub { + owner = "genebean"; + repo = "littlelink"; + rev = "genebean-1.0.1"; + hash = "sha256-r7cvcKdlivQ2MA1UhypwdJrg7CREzTZE5fiNA9AWY/0="; + }; + }; + security.acme.certs."${domain}" = { email = "lets-encrypt@technicalissues.us"; inheritDefaults = false; @@ -38,7 +49,7 @@ in { forceSSL = true; locations = { "/" = { - return = "302 https://beanbag.technicalissues.us"; + root = "/etc/nginx-littlelinks"; }; "/.well-known/lnurlp/genebean" = { return = '' @@ -60,9 +71,15 @@ in { add_header Access-Control-Allow-Origin *; ''; }; + "/api/event" = { + return = "301 https://stats.technicalissues.us/api/event"; + }; "/github" = { return = "301 https://github.com/genebean"; }; + "/js/script.outbound-links.js" = { + return = "301 https://stats.technicalissues.us/js/script.outbound-links.js"; + }; "/mastodon" = { return = "302 https://fosstodon.org/@genebean"; };