feat(users/sterni/mblog): implement mblog executable

This change finally sort of puts the parts together: We take a maildir,
render all its note messages as standalone HTML, extract the attachments
alongside and finally generate a global index page linking all notes.

The new executable and mnote-html are both contained in the same image
and we dispatch the right functionality based on argv[0].

Change-Id: I5a5bdbfaca79199f92e73ea4a2f070fa900d2bc4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5113
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
sterni 2022-01-29 16:18:19 +01:00
parent 6cd1f6f183
commit 98e4cd032f
4 changed files with 237 additions and 19 deletions

View file

@ -1,13 +1,14 @@
{ depot, pkgs, ... }:
depot.nix.buildLisp.program {
name = "mnote-html";
(depot.nix.buildLisp.program {
name = "mblog";
srcs = [
./packages.lisp
./maildir.lisp
./transformer.lisp
./note.lisp
./mblog.lisp
./cli.lisp
];
@ -16,19 +17,29 @@ depot.nix.buildLisp.program {
sbcl = depot.nix.buildLisp.bundled "uiop";
default = depot.nix.buildLisp.bundled "asdf";
}
depot.lisp.klatre
depot.third_party.lisp.alexandria
depot.third_party.lisp.babel
depot.third_party.lisp.closure-html
depot.third_party.lisp.cl-date-time-parser
depot.third_party.lisp.cl-who
depot.third_party.lisp.local-time
depot.third_party.lisp.mime4cl
];
main = "mblog:main";
main = "cli:main";
# due to sclf
brokenOn = [
"ccl"
"ecl"
];
}
}).overrideAttrs (super: {
# The built binary dispatches based on argv[0]. Building two executables would
# waste a lot of space.
buildCommand = ''
${super.buildCommand}
ln -s "$out/bin/mblog" "$out/bin/mnote-html"
'';
})