{ 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 ]; toplevel = [ { route = [ "notes" ]; name = "Notes"; page = router; } ]; notes = [ { route = [ "notes" "preventing-oom" ]; name = "Preventing OOM"; page = renderNote "preventing-oom" ./notes/preventing-oom.md; } { route = [ "notes" "rust-string-conversions" ]; name = "Converting between different String types in Rust"; page = renderNote "rust-string-conversions" ./notes/rust-string-conversions.md; } ]; notesFullRoute = lib.pipe notes [ (map (x@{route, ...}: x // { route = mkRoute route; })) ]; router = lib.pipe notesFullRoute [ (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" { stdin = me.netencode.gen.dwim notesFullRoute; } [ "withstdinas" "-in" "TEMPLATE_DATA" "pipeline" [ bins.printf ''