about summary refs log tree commit diff
path: root/users/Profpatsch/mailbox-org/default.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2023-01-15T20·20+0100
committerProfpatsch <mail@profpatsch.de>2023-01-15T20·36+0000
commitf627ee84b3a002e8f1fe38d7859860faf7d40be9 (patch)
treed541adcae274bacaf95f690d8908a34c2e9bfa4d /users/Profpatsch/mailbox-org/default.nix
parent1a18c25d816298775cafa970c34b7ec41cdf127a (diff)
feat(users/Profpatsch/mailbox-org): add simple request json example r/5661
Adds a simple json quasiquoter thingy.

Json can be sent to the `/mailfilter?action=update` endpoint.

Change-Id: Iba80c2ab69178e431519933c4a01cd68aaa9f637
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7839
Tested-by: BuildkiteCI
Autosubmit: Profpatsch <mail@profpatsch.de>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'users/Profpatsch/mailbox-org/default.nix')
-rw-r--r--users/Profpatsch/mailbox-org/default.nix44
1 files changed, 26 insertions, 18 deletions
diff --git a/users/Profpatsch/mailbox-org/default.nix b/users/Profpatsch/mailbox-org/default.nix
index 99b9d45b7d6a..cd419047223f 100644
--- a/users/Profpatsch/mailbox-org/default.nix
+++ b/users/Profpatsch/mailbox-org/default.nix
@@ -1,27 +1,35 @@
 { depot, pkgs, lib, ... }:
 
 let
+  mailbox-org = pkgs.haskellPackages.mkDerivation {
+    pname = "mailbox-org";
+    version = "0.1.0";
 
-  cas-serve =
-    lib.pipe ./MailboxOrg.hs [
-      (depot.users.Profpatsch.writers.writeHaskellInteractive "mailbox-org"
-        {
-          libraries = [
-            depot.users.Profpatsch.my-prelude
-            depot.users.Profpatsch.execline.exec-helpers-hs
-            depot.users.Profpatsch.arglib.netencode.haskell
-            pkgs.haskellPackages.aeson
-            pkgs.haskellPackages.http-conduit
-            pkgs.haskellPackages.aeson-better-errors
+    src = depot.users.Profpatsch.exactSource ./. [
+      ./mailbox-org.cabal
+      ./AesonQQ.hs
+      ./MailboxOrg.hs
+    ];
 
-          ];
-          ghcArgs = [ "-threaded" ];
-        })
-      (depot.users.Profpatsch.arglib.netencode.with-args {
-        BINS = depot.nix.getBins pkgs.dovecot_pigeonhole [ "sieve-test" ];
-      })
+    libraryHaskellDepends = [
+      depot.users.Profpatsch.my-prelude
+      depot.users.Profpatsch.execline.exec-helpers-hs
+      depot.users.Profpatsch.arglib.netencode.haskell
+      pkgs.haskellPackages.aeson
+      pkgs.haskellPackages.http-conduit
+      pkgs.haskellPackages.aeson-better-errors
     ];
 
+    isLibrary = false;
+    isExecutable = true;
+    license = lib.licenses.mit;
+  };
+
 
 in
-cas-serve
+lib.pipe mailbox-org [
+  (x: (depot.nix.getBins x [ "mailbox-org" ]).mailbox-org)
+  (depot.users.Profpatsch.arglib.netencode.with-args "mailbox-org" {
+    BINS = depot.nix.getBins pkgs.dovecot_pigeonhole [ "sieve-test" ];
+  })
+]