From b6a2f97aa765121ddf61a39fa4b67225db08c18e Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 30 Mar 2025 20:28:24 +0200 Subject: add ai.robots.txt maybe this'll lead to a little fewer traffic on the cgit? --- flora/services/nginx.nix | 12 +++++++++++- npins/sources.json | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/flora/services/nginx.nix b/flora/services/nginx.nix index 4a9bf33..c5aa45b 100644 --- a/flora/services/nginx.nix +++ b/flora/services/nginx.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, inputs, ... }: { networking.firewall.allowedTCPPorts = [ 80 443 ]; @@ -14,11 +14,17 @@ enableACME = true; forceSSL = true; locations."/".root = ../../pkgs/nomsing; + extraConfig = '' + include ${inputs."ai.robots.txt"}/nginx-block-ai-bots.conf; + ''; }; virtualHosts."meow.noms.ing" = { enableACME = true; forceSSL = true; locations."/".root = ../../pkgs/nomsing; + extraConfig = '' + include ${inputs."ai.robots.txt"}/nginx-block-ai-bots.conf; + ''; }; virtualHosts."webring.noms.ing" = { enableACME = true; @@ -29,7 +35,11 @@ fastcgi_param SCRIPT_FILENAME ${lib.getExe pkgs.nomsring}; fastcgi_param PATH_INFO $1; ''; + extraConfig = '' + include ${inputs."ai.robots.txt"}/nginx-block-ai-bots.conf; + ''; }; + }; services.fcgiwrap.instances.nomsing = { diff --git a/npins/sources.json b/npins/sources.json index e11752d..49b5d00 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -1,5 +1,17 @@ { "pins": { + "ai.robots.txt": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "ai-robots-txt", + "repo": "ai.robots.txt" + }, + "branch": "main", + "revision": "5b8650b99b35ff2aa1aa9ae26183b312edc48d45", + "url": "https://github.com/ai-robots-txt/ai.robots.txt/archive/5b8650b99b35ff2aa1aa9ae26183b312edc48d45.tar.gz", + "hash": "1259mjps1f8nkcjzgcvin8d7firbn5q96k1mmcdhv67s6w4ilqfy" + }, "almanac": { "type": "Git", "repository": { -- cgit v1.2.3