modules/aerc: add aba address book

This commit is contained in:
Dmitriy Pleshevskiy 2024-04-20 00:11:44 +03:00
parent 94bb170bca
commit 7055478c6d
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -1,6 +1,23 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
aercPackage = pkgs.unstable.aerc.override {
# support .filename filter
buildGoModule = args: pkgs.unstable.buildGoModule (args // rec {
version = "6ffc0ed5991bef69a50cbc22647af0a6a0e0a895";
src = pkgs.fetchFromSourcehut {
owner = "~rjarry";
repo = "aerc";
rev = version;
hash = "sha256-IyAcTCDSjOmZ6KPr9nYKdxWA0qryeU4jTwxRWzt2NOY=";
};
vendorHash = "sha256-pir78zXidz7N9Z6uw9YqkkjVRUho0PuKgDTQFli/4fs=";
});
};
abaPackage = pkgs.unstable.aba;
pipeAba = param: exec ":pipe -m ${abaPackage}/bin/aba parse ${param}";
exec = cmd: ":${cmd}<Enter>"; exec = cmd: ":${cmd}<Enter>";
fill = cmd: ":${cmd}<space>"; fill = cmd: ":${cmd}<space>";
@ -15,20 +32,10 @@ let
"mA" = exec "archive flat"; "mA" = exec "archive flat";
"mS" = exec "move Junk"; "mS" = exec "move Junk";
"mI" = exec "move INBOX"; "mI" = exec "move INBOX";
}; "af" = pipeAba "--from";
"at" = pipeAba "--to";
aercPackage = pkgs.unstable.aerc.override { "ac" = pipeAba "--cc";
# support .filename filter "aa" = pipeAba "--all";
buildGoModule = args: pkgs.unstable.buildGoModule (args // rec {
version = "6ffc0ed5991bef69a50cbc22647af0a6a0e0a895";
src = pkgs.fetchFromSourcehut {
owner = "~rjarry";
repo = "aerc";
rev = version;
hash = "sha256-IyAcTCDSjOmZ6KPr9nYKdxWA0qryeU4jTwxRWzt2NOY=";
};
vendorHash = "sha256-pir78zXidz7N9Z6uw9YqkkjVRUho0PuKgDTQFli/4fs=";
});
}; };
in in
{ {
@ -63,6 +70,10 @@ in
column-from = "{{ .From | emails | join \", \" }}"; column-from = "{{ .From | emails | join \", \" }}";
}; };
compose = {
address-book-cmd = "${abaPackage}/bin/aba ls '%s'";
};
statusline = { statusline = {
display-mode = "icon"; display-mode = "icon";
}; };