diff --git a/flake.lock b/flake.lock index 66cb95e..dfe9f89 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "alex": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "nixpkgs-python": "nixpkgs-python" + }, + "locked": { + "lastModified": 1727894075, + "narHash": "sha256-2yGczQTBlMkImM95Q7fmrUX16CJ5y1OTe/KlyXwIo8g=", + "owner": "AlexanderGrooff", + "repo": "nix-flakes", + "rev": "248ec1e226de7e3cd86092312910158c1fea3402", + "type": "github" + }, + "original": { + "owner": "AlexanderGrooff", + "repo": "nix-flakes", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1744386647, @@ -15,21 +35,19 @@ "type": "github" } }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, + "flake-compat": { + "flake": false, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "edolstra", + "repo": "flake-compat", "type": "github" } }, @@ -55,6 +73,59 @@ "inputs": { "systems": "systems_2" }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, "locked": { "lastModified": 1731533236, "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", @@ -72,8 +143,8 @@ "markdoll": { "inputs": { "crane": "crane", - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2", + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_5", "rust-overlay": "rust-overlay" }, "locked": { @@ -90,13 +161,97 @@ "url": "https://codeberg.org/0x57e11a/markdoll.git" } }, + "mermaid-ascii": { + "inputs": { + "alex": "alex", + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1729281716, + "narHash": "sha256-CkfYSDm5Mg+2EN42IiAh5F070Hi8octtB9FAoiHorLo=", + "owner": "AlexanderGrooff", + "repo": "mermaid-ascii", + "rev": "0a4a78057fbd9aff8db8746c54bb87a424bc4b53", + "type": "github" + }, + "original": { + "owner": "AlexanderGrooff", + "repo": "mermaid-ascii", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1745234285, - "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", + "lastModified": 1727893769, + "narHash": "sha256-RQIsGOy+7VzPJ4eHS2UENKGgGnW6WXQJqm+8d7BsRKc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", + "rev": "bc63f402fdf4ad861b18746174d4e1fd37fcc4b0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-python": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1722978926, + "narHash": "sha256-sqOOEaKJJSUFBzag/cGeeXV491TrrVFY3DFBs1w20V8=", + "owner": "cachix", + "repo": "nixpkgs-python", + "rev": "7c550bca7e6cf95898e32eb2173efe7ebb447460", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "nixpkgs-python", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1719253556, + "narHash": "sha256-A/76RFUVxZ/7Y8+OMVL1Lc8LRhBxZ8ZE2bpMnvZ1VpY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fc07dc3bdf2956ddd64f24612ea7fc894933eb2e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1727811607, + "narHash": "sha256-2ByOBflaIUJKeF9q6efVcYHljZXGZ7MnCWtseRvmpm8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1839883cd0068572aed75fb9442b508bbd9ef09c", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1747179050, + "narHash": "sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "adaa24fbf46737f3f1b5497bf64bae750f82942e", "type": "github" }, "original": { @@ -106,22 +261,7 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1743296961, - "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, - "nixpkgs_2": { + "nixpkgs_5": { "locked": { "lastModified": 1744536153, "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=", @@ -137,7 +277,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_6": { "locked": { "lastModified": 1744868846, "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", @@ -155,8 +295,9 @@ }, "root": { "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs", + "flake-utils": "flake-utils", + "mermaid-ascii": "mermaid-ascii", + "nixpkgs": "nixpkgs_4", "teapot": "teapot" } }, @@ -212,18 +353,63 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "teapot": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_4", "markdoll": "markdoll", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1745381508, - "narHash": "sha256-mQYFQ8e0AnfsYcHO8O8oAbTrou6iOc3HR23hVguQVYs=", + "lastModified": 1747275871, + "narHash": "sha256-1GvVW/B27P3rWpck5Pu973HXSbH3zZbSwA2Jzb35eHA=", "ref": "refs/heads/main", - "rev": "a4faf2f38c06d238874fb88e2fca1bcad9a05c72", - "revCount": 8, + "rev": "f9dd88697493518bacae5c9fb5ff985b11946ee3", + "revCount": 15, "type": "git", "url": "https://git.sapphic.engineer/noe/teapot" }, diff --git a/flake.nix b/flake.nix index 770effd..92bac7b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,36 +1,43 @@ { - description = "https://noe.sh"; + description = "https://blood.pet"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; + flake-utils.url = "github:numtide/flake-utils"; teapot.url = "git+https://git.sapphic.engineer/noe/teapot"; + mermaid-ascii.url = "github:AlexanderGrooff/mermaid-ascii"; }; - outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ "x86_64-linux" "aarch64-linux" ]; - perSystem = { config, self', pkgs, lib, system, ... }: let - in rec { + outputs = { self, nixpkgs, flake-utils, ... }@inputs: flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs { + inherit system; + overlays = [ + inputs.teapot.overlays.default + (final: prev: { + mermaid-ascii = inputs.mermaid-ascii.packages.${system}.default; + }) + ]; + }; + in { devShells.default = import ./shell.nix { inherit pkgs; }; - apps.default = apps.dev; - apps.dev = pkgs.writeShellScript "noe.sh" '' - ${pkgs.python3} -m http.server -d ${packages.default} - ''; - - packages.default = inputs.teapot.packages.${system}.brewTea { - name = "noe.sh"; + packages.default = pkgs.brewTea { + name = "blood.pet"; version = "0.0.0"; src = ./.; layoutSrc = ./layouts; + staticAssets = [ "./static" ]; - markdollPlugins = let - mkMarkdollPlugin = inputs.teapot.packages.${system}.mkMarkdollPlugin; - in [ - (mkMarkdollPlugin "utils" ./plugins/utils.sh) + markdollPlugins = [ + (pkgs.mkMarkdollPlugin "utils" ./plugins/utils.sh) + (pkgs.mkMarkdollPlugin "logroll" ./plugins/logroll.sh) + + (pkgs.mkMarkdollPlugin "mermaid" ./plugins/mermaid.sh) + pkgs.mermaid-ascii ]; }; - }; - }; + } + ); } \ No newline at end of file diff --git a/layouts/default.html b/layouts/default.html index f0c698e..42007a1 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -2,29 +2,7 @@
+ HTTP/1.1 200 OK + Accept-Ranges: bytes + Content-Length: 25956 + Content-Type: text/html + ETag: "e00f624fab315d9e804999ab2994f16c" + Last-Modified: Wed, 14 May 2025 07:20:42 GMT + Server: MinIO + Strict-Transport-Security: max-age=31536000; includeSubDomains + Vary: Origin + Vary: Accept-Encoding + X-Amz-Bucket-Region: us-east-1 + X-Amz-Id-2: dd9025bab4ad464b049177c95eb6ebf374d3b3fd1af9251148b658df7ac2e3e8 + X-Amz-Request-Id: 183F92F40CF892BF + X-Content-Type-Options: nosniff + X-Ratelimit-Limit: 583 + X-Ratelimit-Remaining: 583 + X-Xss-Protection: 1; mode=block + x-amz-meta-s3cmd-attrs: atime:1747207238/ctime:1747207238/gid:0/gname:root/md5:e00f624fab315d9e804999ab2994f16c/mode:33060/mtime:1/uid:0/uname:root + Date: Thu, 15 May 2025 02:39:17 GMT ++ ] + + the headers include everything from the s3cmd user (root because docker) to random AWS IDs.
" +mermaid-ascii --file /dev/stdin $@ +echo "" \ No newline at end of file diff --git a/plugins/plural.sh b/plugins/plural.sh new file mode 100755 index 0000000..cc1f786 --- /dev/null +++ b/plugins/plural.sh @@ -0,0 +1 @@ +#!/bin/bash \ No newline at end of file diff --git a/static/main.css b/static/main.css new file mode 100644 index 0000000..f8cef2e --- /dev/null +++ b/static/main.css @@ -0,0 +1,55 @@ +:root { + --red1: #a20000; + --red2: #c20000; + --dark1: #071213; + --dark2: #000000; + --bright1: #aed3d4; + --middle1: #3f7c59; +} + +body { + background-color: var(--dark2); + color: var(--red2); + font-family: monospace; + font-size: 1.012rem; + margin: 0; + padding: 0; +} + +main { + margin: 2rem; + width: 780px; + max-width: calc(100vw - 4rem); +} + +h1, +h2, +h3, +h4, +h5, +h6 { + color: var(--bright1); + margin-top: 2em; +} + +code { + background-color: var(--dark1); + padding: 0.1rem; + border-radius: 2px; + color: var(--middle1); +} + +.doll-inline { + margin-bottom: 1rem; +} + +.doll-code-block { + background-color: var(--dark1); + padding: 0.4rem 1rem; + color: var(--middle1); + border-left: 1px solid var(--red1); + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; + overflow-x: scroll; + tab-size: 2; +}