about summary refs log tree commit diff
path: root/users/sterni/mblog/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-01-29T15·18+0100
committersterni <sternenseemann@systemli.org>2022-02-02T20·47+0000
commit98e4cd032f45ade1c408162ebccd914f31266f9f (patch)
tree6797a088e78f2e46e77ac6f2151d28c5d1c2d8d1 /users/sterni/mblog/default.nix
parent6cd1f6f183317fab7661c907686df04bb6b7ade9 (diff)
feat(users/sterni/mblog): implement mblog executable r/3752
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>
Diffstat (limited to 'users/sterni/mblog/default.nix')
-rw-r--r--users/sterni/mblog/default.nix19
1 files changed, 15 insertions, 4 deletions
diff --git a/users/sterni/mblog/default.nix b/users/sterni/mblog/default.nix
index cc605d7cd2ae..00e8b39ada0d 100644
--- a/users/sterni/mblog/default.nix
+++ b/users/sterni/mblog/default.nix
@@ -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"
+  '';
+})