{ depot, pkgs, lib, ... }: let bins = depot.nix.getBins pkgs.lowdown [ "lowdown" ] // depot.nix.getBins pkgs.cdb [ "cdbget" "cdbmake" "cdbdump" ] // depot.nix.getBins pkgs.coreutils [ "mv" "cat" "printf" "tee" "env" "test" "echo" "printenv" ] // depot.nix.getBins pkgs.bash [ "bash" ] // depot.nix.getBins pkgs.s6-networking [ "s6-tcpserver" ] // depot.nix.getBins pkgs.time [ "time" ] ; me = depot.users.Profpatsch; renderNote = name: note: depot.nix.runExecline "${name}.html" {} [ "importas" "out" "out" bins.lowdown "-s" "-Thtml" "-o" "$out" note ]; preventing-oom = renderNote "preventing-oom" ./notes/preventing-oom.md; notes = [ { route = [ "notes" "preventing-oom" ]; name = "Preventing OOM"; page = preventing-oom; } ]; router = lib.pipe notes [ (map (x@{route, ...}: x // { route = mkRoute route; })) (map (x: { name = x.route; value = me.netencode.gen.dwim x; })) lib.listToAttrs (cdbMake "notes-router") ]; router-lookup = depot.nix.writeExecline "router-lookup" { readNArgs = 1; } [ cdbLookup router "$1" ]; runExeclineStdout = name: args: cmd: depot.nix.runExecline name args ([ "importas" "-ui" "out" "out" "redirfd" "-w" "1" "$out" ] ++ cmd); index = runExeclineStdout "index" {} [ "backtick" "-in" "TEMPLATE_DATA" [ cdbDumpNetencode router ] "pipeline" [ bins.printf ''