Compare commits

...

2 commits

Author SHA1 Message Date
98acc3644c
bert: Upgrade Navidrome to 0.57.0 2025-07-23 13:59:12 -05:00
d69b4cf8ab
bert: Add bible.chandlerswift.com 2025-07-23 13:59:08 -05:00
4 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Chandler's Bible API Mirror</title>
<style>
body { font-family: sans-serif; max-width: 600px; margin: auto; padding: 2em; }
code { background: #eee; padding: 0.2em 0.4em; }
</style>
</head>
<body>
<h1>Chandler's Bible API Mirror</h1>
<p>This site mirrors the public domain Bible API from <a href="https://bible.helloao.org/">bible.helloao.org</a>.</p>
<h2>License</h2>
<p>The Holy Bible, Berean Standard Bible, BSB is produced in cooperation with Bible Hub, Discovery Bible, OpenBible.com, and the Berean Bible Translation Committee. This text of God's Word has been dedicated to the public domain.</p>
<p><a href="https://berean.bible/terms.htm">https://berean.bible/terms.htm</a></p>
<p>You can fetch JSON files under the <code>/api/</code> path. For example:</p>
<ul>
<li><code><a href="/api/BSB/books.json">/api/available_translations.json</a></code>: A list of available translations</li>
<li><code><a href="/api/BSB/books.json">/api/BSB/books.json</a></code>: All books of the Berean Standard Bible</li>
<li><code><a href="/api/BSB/GEN.json">/api/BSB/GEN/1.json</a></code>: Genesis 1, Berean Standard Bible</li>
</ul>
</body>
</html>

View file

@ -0,0 +1,48 @@
{ pkgs, ... }:
let
bibleApiPackage = pkgs.stdenv.mkDerivation {
pname = "bible-api";
version = "2025-07-18";
src = pkgs.fetchzip {
url = "https://bible.helloao.org/api.zip";
hash = "sha256-bYl8svY++D0+YHXZ8/3h+yn0xiqIDCXcN+Hh9FjP98k=";
stripRoot = false;
};
dontBuild = true;
installPhase = ''
mkdir -p $out/api
mv * $out/api/
'';
};
in {
services.caddy.enable = true;
services.caddy.virtualHosts."bible.chandlerswift.com" = {
extraConfig = ''
encode zstd gzip
file_server
root * ${bibleApiPackage}
handle / {
header Content-Type text/html
# This is a bit of a hack, but I was unable to find a better way to just
# serve the contents of the file. If I knew the directory of the file
# and its filename, I think I could use file_server with try_files, but
# if I do a `file_server` with `.\${./bible.chandlerswift.com.html}`, then
# bible.chandlerswift.com.html just gets copied as a file into nix-store
# and I don't know its name. ...or something? Anyway this seems to work!
respond <<EOF
${builtins.readFile ./bible.chandlerswift.com.html}
EOF
}
handle_errors {
respond "{err.status_code} {err.status_text}"
}
'';
};
}

View file

@ -2,6 +2,7 @@
imports = [
./0hats.com.nix
./bannergen.chandlerswift.com.nix
./bible.chandlerswift.com.nix
./chandlerswift.com.nix
./darylfanclub.chandlerswift.com.nix
./flintlock.chandlerswift.com.nix

View file

@ -1,6 +1,8 @@
{
services.navidrome = {
enable = true;
# 0.57.0
package = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/96576911776181ae921f7d9dffb0a20cca4dd1b1.tar.gz") {}).navidrome;
settings = {
MusicFolder = "/mnt/bigbird_public/media/music";
ScanSchedule = "@every 12h";