This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

pkgs.tangled: init at 0-unstable-2026-10-18

+308
+58
pkgs/tangled/assets.json
··· 1 + { 2 + "actor-typeahead-src": { 3 + "type": "git", 4 + "url": "https://tangled.org/@jakelazaroff.com/actor-typeahead", 5 + "rev": "677fe7f743050a4e7f09d4a6f87bbf1325a06f6b", 6 + "hash": "sha256-heizoWUKDdar6ymfZTnj3ytcEv/L4d4fzSmtr0HlXsQ=" 7 + }, 8 + "hls-src": { 9 + "type": "file", 10 + "url": "https://cdn.jsdelivr.net/npm/hls.js@1.5.13/dist/hls.min.js", 11 + "hash": "sha256-mmxgaQRXXWzRG6/OlOn5efV+NmzhvmXTQaFbODqh0b8=" 12 + }, 13 + "htmx-src": { 14 + "type": "file", 15 + "url": "https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js", 16 + "hash": "sha256-2D8I0L0u6qb57QpeVn88RrT0xatDwQwG/lWOTjuEFPc=" 17 + }, 18 + "htmx-ws-src": { 19 + "type": "file", 20 + "url": "https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.4", 21 + "hash": "sha256-woiluaeAoxH/CyDkpk6LYNWCzxH8PHgwgnrlBFGJxgk=" 22 + }, 23 + "ibm-plex-mono-src": { 24 + "type": "tarball", 25 + "url": "https://github.com/IBM/plex/releases/download/@ibm%2Fplex-mono@1.1.0/ibm-plex-mono.zip", 26 + "hash": "sha256-OwUmrPfEehLDz0fl2ChYLK8FQM2p0G1+EMrGsYEq+6g=" 27 + }, 28 + "inter-fonts-src": { 29 + "type": "tarball", 30 + "url": "https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip", 31 + "hash": "sha256-5vdKKvHAeZi6igrfpbOdhZlDX2/5+UvzlnCQV6DdqoQ=" 32 + }, 33 + "lucide-src": { 34 + "type": "tarball", 35 + "url": "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip", 36 + "hash": "sha256-+exBR2OToB1iv7ZQI2S4B0lXA/QRvC9n6U99UxGpJGs=" 37 + }, 38 + "mathjax-src": { 39 + "type": "file", 40 + "url": "https://cdn.jsdelivr.net/npm/mathjax@4.1.2/tex-svg.js", 41 + "hash": "sha256-eqg25bKfiDzynRMR2RfeWNfo0EefHF/eRRFafl9RnNI=" 42 + }, 43 + "mermaid-src": { 44 + "type": "file", 45 + "url": "https://cdn.jsdelivr.net/npm/mermaid@11.12.3/dist/mermaid.min.js", 46 + "hash": "sha256-/YOdECG2V5c3kJ1QfGvhziTT6K/Dx/4mOk2mr3Fs/do=" 47 + }, 48 + "sqlite-lib-src": { 49 + "type": "tarball", 50 + "url": "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip", 51 + "hash": "sha256-bJoMjirsBjm2Qk9KPiy3yV3+8b/POlYe76/FQbciHro=" 52 + }, 53 + "tailwindcss-animated-src": { 54 + "type": "tarball", 55 + "url": "https://registry.npmjs.org/tailwindcss-animated/-/tailwindcss-animated-1.1.2.tgz", 56 + "hash": "sha256-l3esIcsAwj0PHOhnHBLWiLzzRiOo1yOk9VYEGpn6fyQ=" 57 + } 58 + }
+181
pkgs/tangled/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + buildGoModule, 5 + rustPlatform, 6 + fetchgit, 7 + fetchurl, 8 + fetchzip, 9 + linkFarm, 10 + runCommandLocal, 11 + symlinkJoin, 12 + writeShellScriptBin, 13 + cmake, 14 + perl, 15 + tailwindcss, 16 + }: 17 + 18 + # Tangled (https://tangled.org) without its flake: the appview, knot 2 19 + # (knot-rs) and knotmirror, built the way its nix/pkgs files do. tap and goat 20 + # come from nixpkgs (tap, atproto-goat). 21 + let 22 + version = "0-unstable-2026-10-18"; 23 + 24 + src = fetchgit { 25 + url = "https://tangled.org/tangled.org/core"; 26 + rev = "dad751949f865d6189f7602e1409c5f951e75771"; 27 + hash = "sha256-pehXSw17JRgWA/d4t/x9ZcdxOHJaY3I0+H+3p1hVZxk="; 28 + }; 29 + 30 + # The *-src inputs of the flake at that rev, generated by update.sh from 31 + # its flake.lock; the hashes are the lock's narHashes. 32 + assets = lib.mapAttrs ( 33 + name: a: 34 + { 35 + file = fetchurl { 36 + inherit name; 37 + inherit (a) url hash; 38 + recursiveHash = true; 39 + }; 40 + tarball = fetchzip { 41 + inherit name; 42 + inherit (a) url hash; 43 + # flake tarballs only drop a single top-level directory 44 + stripRoot = name != "inter-fonts-src"; 45 + }; 46 + git = fetchgit { inherit (a) url rev hash; }; 47 + } 48 + .${a.type} 49 + ) (lib.importJSON ./assets.json); 50 + 51 + # The Go programs share the root go.mod, so one vendor directory. 52 + buildTangledGo = 53 + pname: args: 54 + buildGoModule ( 55 + { 56 + inherit pname version src; 57 + vendorHash = "sha256-6eDNOcnMHMpdQS7M7A8O+wZOnP2/968Re7Iqn8XgGNM="; 58 + overrideModAttrs = _: { name = "tangled-${version}-go-modules"; }; 59 + subPackages = [ "cmd/${pname}" ]; 60 + doCheck = false; 61 + meta.mainProgram = pname; 62 + } 63 + // args 64 + ); 65 + 66 + sqlite-lib = stdenv.mkDerivation { 67 + name = "sqlite-lib"; 68 + src = assets.sqlite-lib-src; 69 + buildPhase = '' 70 + $CC -c sqlite3.c 71 + $AR rcs libsqlite3.a sqlite3.o 72 + $RANLIB libsqlite3.a 73 + ''; 74 + installPhase = '' 75 + mkdir -p $out/include $out/lib 76 + cp *.h $out/include 77 + cp libsqlite3.a $out/lib 78 + ''; 79 + }; 80 + 81 + dolly-unwrapped = buildTangledGo "dolly" { }; 82 + dolly = writeShellScriptBin "dolly" '' 83 + exec ${dolly-unwrapped}/bin/dolly \ 84 + -template ${src}/appview/pages/templates/fragments/dolly \ 85 + "$@" 86 + ''; 87 + 88 + tailwindcss-plugins = linkFarm "tailwindcss-plugins" [ 89 + { 90 + name = "tailwindcss-animated"; 91 + path = assets.tailwindcss-animated-src; 92 + } 93 + ]; 94 + 95 + static-files = runCommandLocal "appview-static-files" { } '' 96 + mkdir -p $out/{fonts,icons,logos} && cd $out 97 + cp -f ${assets.htmx-src} htmx.min.js 98 + cp -f ${assets.htmx-ws-src} htmx-ext-ws.min.js 99 + cp -f ${assets.mermaid-src} mermaid.min.js 100 + cp -f ${assets.hls-src} hls.min.js 101 + cp -f ${assets.mathjax-src} mathjax.min.js 102 + cp -rf ${assets.lucide-src}/*.svg icons/ 103 + cp -rf ${src}/icons/*.svg icons/ 104 + cp -f ${assets.inter-fonts-src}/web/InterVariable*.woff2 fonts/ 105 + cp -f ${assets.inter-fonts-src}/web/InterDisplay*.woff2 fonts/ 106 + cp -f ${assets.inter-fonts-src}/InterVariable*.ttf fonts/ 107 + cp -f ${assets.ibm-plex-mono-src}/fonts/complete/woff2/IBMPlexMono*.woff2 fonts/ 108 + cp -f ${assets.actor-typeahead-src}/actor-typeahead.js . 109 + cp -rf ${src}/appview/pages/profile-fx . 110 + 111 + ${dolly}/bin/dolly -output logos/dolly.png -size 180 112 + ${dolly}/bin/dolly -output logos/dolly.ico -size 48 113 + ${dolly}/bin/dolly -output logos/dolly.svg -color currentColor -favicon 114 + export NODE_PATH=${tailwindcss-plugins} 115 + cd ${src} && ${tailwindcss}/bin/tailwindcss -i input.css -o $out/tw.css 116 + ''; 117 + 118 + appview = buildTangledGo "appview" { 119 + postUnpack = '' 120 + mkdir -p $sourceRoot/appview/pages/static 121 + cp -fr ${static-files}/* $sourceRoot/appview/pages/static 122 + ''; 123 + tags = [ "libsqlite3" ]; 124 + env = { 125 + CGO_ENABLED = 1; 126 + CGO_CFLAGS = "-I ${sqlite-lib}/include "; 127 + CGO_LDFLAGS = "-L ${sqlite-lib}/lib"; 128 + }; 129 + }; 130 + 131 + knotmirror = buildTangledGo "knotmirror" { }; 132 + 133 + knot-rs = rustPlatform.buildRustPackage { 134 + pname = "knot-server"; 135 + inherit version src; 136 + cargoHash = "sha256-3YPqGQS1yVF+Pmj0Xe2z6yITLl7RgwPMPY389MB8lw8="; 137 + nativeBuildInputs = [ 138 + cmake 139 + perl 140 + ]; 141 + dontUseCmakeConfigure = true; 142 + cargoBuildFlags = [ 143 + "--bin" 144 + "knot-server" 145 + "--package" 146 + "knot-server" 147 + ]; 148 + doCheck = false; 149 + meta.mainProgram = "knot-server"; 150 + }; 151 + in 152 + symlinkJoin { 153 + pname = "tangled"; 154 + inherit version; 155 + paths = [ 156 + appview 157 + knot-rs 158 + knotmirror 159 + ]; 160 + 161 + passthru = { 162 + inherit 163 + src 164 + assets 165 + sqlite-lib 166 + dolly 167 + static-files 168 + appview 169 + knot-rs 170 + knotmirror 171 + ; 172 + updateScript = ./update.sh; 173 + }; 174 + 175 + meta = { 176 + description = "Git collaboration platform on atproto: appview, knot and knotmirror"; 177 + homepage = "https://tangled.org/tangled.org/core"; 178 + license = lib.licenses.mit; 179 + platforms = lib.platforms.linux; 180 + }; 181 + }
+69
pkgs/tangled/update.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + # Tangled has no releases for the knot-rs era and isn't on GitHub, so 5 + # nix-update can't follow it: bump src to the head of master, take the 6 + # frontend assets (the flake's *-src inputs) from its flake.lock and probe the 7 + # Go vendor and cargo hashes. 8 + attr=tangled 9 + url=https://tangled.org/tangled.org/core 10 + 11 + # Run by update-pkgs from the flake root ($0 is a read-only store copy). 12 + dir=pkgs/tangled 13 + pkg=$dir/package.nix 14 + # Linux-only package: always evaluate/build the x86_64-linux variant. 15 + build_attr=".#packages.x86_64-linux.$attr" 16 + 17 + new_rev=$(git ls-remote "$url" refs/heads/master | cut -f1) 18 + old_rev=$(sed -n 's|^ *rev = "\([^"]*\)";|\1|p' "$pkg") 19 + if [ "$old_rev" = "$new_rev" ]; then 20 + echo "$attr: already up to date ($new_rev)" 21 + exit 0 22 + fi 23 + 24 + # The flake fetcher's narHash is fetchgit's hash, and its store path has the 25 + # flake.lock with the asset pins. 26 + prefetch=$(nix flake prefetch --json "git+$url?rev=$new_rev") 27 + src_hash=$(jq -r .hash <<<"$prefetch") 28 + src_path=$(jq -r .storePath <<<"$prefetch") 29 + new_date=$(date -u -d "@$(jq -r .locked.lastModified <<<"$prefetch")" +%F) 30 + new_version="0-unstable-$new_date" 31 + 32 + jq '.nodes as $n 33 + | [.nodes.root.inputs | to_entries[] | select(.key | endswith("-src")) 34 + | { key, value: ($n[.value].locked 35 + | { type, url } + (if .rev then { rev } else {} end) + { hash: .narHash }) }] 36 + | sort_by(.key) | from_entries' "$src_path/flake.lock" >"$dir/assets.json" 37 + 38 + # Bump rev + version and blank the derived hashes: with the old ones in place 39 + # nix reuses the cached FODs and the build "succeeds" on stale code. 40 + sed -i \ 41 + -e "s|^\( *\)rev = \".*\";|\1rev = \"$new_rev\";|" \ 42 + -e "s|^\( *\)version = \".*\";|\1version = \"$new_version\";|" \ 43 + -e "s|^\( *\)hash = \"sha256-.*\";|\1hash = \"$src_hash\";|" \ 44 + -e "s|^\( *\)vendorHash = \".*\";|\1vendorHash = \"\";|" \ 45 + -e "s|^\( *\)cargoHash = \".*\";|\1cargoHash = \"\";|" \ 46 + "$pkg" 47 + 48 + # The probe build is *expected* to fail (hash mismatch); `|| true` keeps 49 + # pipefail/errexit from turning that into an empty `got`. awk must not 50 + # `exit` early or tee dies of SIGPIPE and takes the pipeline with it. 51 + probe_hash() { 52 + { nix build --no-link "$build_attr$1" 2>&1 || true; } | tee /dev/stderr | 53 + awk '/got:/ && !seen { print $2; seen = 1 }' || true 54 + } 55 + 56 + # Probe each FOD on its own so a hash is never attributed to the wrong field. 57 + for spec in vendorHash:.appview.goModules cargoHash:.knot-rs.cargoDeps; do 58 + field=${spec%%:*} 59 + got=$(probe_hash "${spec#*:}") 60 + if [ -z "$got" ]; then 61 + echo "$attr: no hash reported for $field" >&2 62 + exit 1 63 + fi 64 + sed -i "s|^\( *\)$field = \"[^\"]*\";|\1$field = \"$got\";|" "$pkg" 65 + echo "$attr: $field → $got" 66 + done 67 + 68 + echo "$attr: updated to $new_rev ($new_version)" 69 + nix build --no-link "$build_attr"