snix/users/sterni/blërg/default.nix
sterni 5cd3d9e3ac feat(sterni/blërg/git): render html, org and md entries
Markup for the git backend is implemented as a lookup table to commands
that read markup on stdin and write it to stdout. Markdown uses lowdown,
Org pandoc and HTML doesn't need to be altered.

Future Work:

- Title extraction from the files instead of the file name. Since we use
  the file name as ids in the git backend, it is currently impossible to
  change the title without breaking links.
- Use emacs for Org. Unfortunately, it is really slow, so we may need to
  do something drastic, like writing an sourcegraph style markup
  conversion service or dumping an emacs image.
- Copy post dependencies, e.g. included images.

Change-Id: I88ad4cc18ada1d68d81fdecf685096f105e3fef3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/13110
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
2025-02-08 22:40:42 +00:00

42 lines
965 B
Nix

{ depot, pkgs, lib, ... }:
let
# update README.md when changing this
runtimeDependencies = [
depot.users.sterni.mn2html
pkgs.mblaze
pkgs.execline # execline-cd, importas, pipeline
# coreutils # for printf (assumed to be installed)
pkgs.pandoc
pkgs.lowdown
];
# … and this
buildInputs = [
pkgs.cbqn
];
BQN_LIBS = depot.third_party.bqn-libs + "/lib";
in
pkgs.runCommandNoCC "blerg"
{
src = builtins.path {
name = "blerg.bqn";
path = ./. + "/blërg.bqn";
};
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];
inherit buildInputs;
passthru.shell = pkgs.mkShell {
name = "blërg-shell";
packages = runtimeDependencies ++ buildInputs;
inherit BQN_LIBS;
};
}
''
install -Dm755 "$src" "$out/bin/blërg"
patchShebangs "$out/bin/blërg"
wrapProgram "$out/bin/blërg" \
--prefix PATH : "${lib.makeBinPath runtimeDependencies}" \
--set BQN_LIBS "${BQN_LIBS}"
''