2023-10-24 04:50:31 +00:00
|
|
|
# geary is a gtk3 email client.
|
|
|
|
# outstanding issues:
|
|
|
|
# - it uses webkitgtk_4_1, which is expensive to build.
|
|
|
|
# could be upgraded to webkitgtk latest if upgraded to gtk4
|
|
|
|
# <https://gitlab.gnome.org/GNOME/geary/-/issues/1212>
|
2023-11-14 00:38:06 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.sane.programs."gnome.geary";
|
|
|
|
in
|
2023-10-24 04:50:31 +00:00
|
|
|
{
|
|
|
|
sane.programs."gnome.geary" = {
|
2023-11-14 00:38:06 +00:00
|
|
|
configOption = with lib; mkOption {
|
|
|
|
default = {};
|
|
|
|
type = types.submodule {
|
|
|
|
options.autostart = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-27 11:28:08 +00:00
|
|
|
sandbox.method = "bwrap";
|
2024-01-29 13:45:57 +00:00
|
|
|
sandbox.wrapperType = "wrappedDerivation";
|
2024-02-08 21:51:32 +00:00
|
|
|
sandbox.net = "clearnet";
|
2024-02-13 11:58:12 +00:00
|
|
|
sandbox.whitelistDbus = [ "user" ]; # notifications
|
2024-02-14 01:49:49 +00:00
|
|
|
sandbox.whitelistWayland = true;
|
2024-01-27 11:28:08 +00:00
|
|
|
sandbox.extraPaths = [
|
|
|
|
# geary sandboxes *itself* with bwrap, and dbus-proxy which, confusingly, causes it to *require* these paths.
|
|
|
|
# TODO: these could maybe be mounted empty. or maybe there's an env-var to disable geary's dbus-proxy.
|
|
|
|
"/sys/block"
|
|
|
|
"/sys/bus"
|
|
|
|
"/sys/class"
|
|
|
|
"/sys/dev"
|
|
|
|
"/sys/devices"
|
|
|
|
"/sys/fs"
|
|
|
|
];
|
|
|
|
# if sandbox.method == "landlock", then these dirs must exist in the sandbox, even if empty.
|
|
|
|
# fs.".config/geary".dir = {};
|
|
|
|
# fs.".local/share/folks".dir = {};
|
2024-01-22 10:04:18 +00:00
|
|
|
|
2023-11-18 22:06:08 +00:00
|
|
|
slowToBuild = true; # uses webkitgtk 4.1
|
2023-11-08 15:32:50 +00:00
|
|
|
persist.byStore.private = [
|
2023-10-24 04:50:31 +00:00
|
|
|
# attachments, and email -- contained in a sqlite db
|
|
|
|
".local/share/geary"
|
2023-10-24 10:28:12 +00:00
|
|
|
# also `.cache/geary/web-resources`, which tends to stay << 1 MiB
|
2023-10-24 04:50:31 +00:00
|
|
|
];
|
2023-10-24 10:28:12 +00:00
|
|
|
fs.".config/geary/account_01/geary.ini".symlink.text = ''
|
2023-10-24 04:50:31 +00:00
|
|
|
[Metadata]
|
|
|
|
version=1
|
|
|
|
status=enabled
|
|
|
|
|
|
|
|
[Account]
|
|
|
|
ordinal=2
|
|
|
|
label=
|
|
|
|
# 14 = "fetch last 14d of mail every time i connect"
|
|
|
|
# -1 = "fetch *all* mail"
|
|
|
|
prefetch_days=-1
|
|
|
|
save_drafts=true
|
|
|
|
save_sent=true
|
|
|
|
use_signature=false
|
|
|
|
signature=
|
|
|
|
sender_mailboxes=colin@uninsane.org;
|
|
|
|
service_provider=other
|
|
|
|
|
|
|
|
[Folders]
|
|
|
|
archive_folder=Archive;
|
|
|
|
drafts_folder=
|
|
|
|
sent_folder=
|
|
|
|
junk_folder=
|
|
|
|
trash_folder=
|
|
|
|
|
|
|
|
[Incoming]
|
|
|
|
login=colin
|
|
|
|
remember_password=true
|
|
|
|
host=imap.uninsane.org
|
|
|
|
port=993
|
|
|
|
transport_security=transport
|
|
|
|
credentials=custom
|
|
|
|
|
|
|
|
[Outgoing]
|
|
|
|
remember_password=true
|
|
|
|
host=mx.uninsane.org
|
|
|
|
port=465
|
|
|
|
transport_security=transport
|
|
|
|
credentials=use-incoming
|
|
|
|
'';
|
2023-11-27 07:48:36 +00:00
|
|
|
secrets.".config/geary/account_02/geary.ini" = ../../../secrets/common/geary_account_02.ini.bin;
|
2023-11-14 00:38:06 +00:00
|
|
|
|
|
|
|
services.geary = {
|
2024-02-19 12:57:44 +00:00
|
|
|
description = "geary email client";
|
|
|
|
after = [ "graphical-session.target" ];
|
|
|
|
# partOf = [ "graphical-session.target" ];
|
2024-02-02 14:21:57 +00:00
|
|
|
wantedBy = lib.mkIf cfg.config.autostart [ "graphical-session.target" ];
|
2024-02-19 12:57:44 +00:00
|
|
|
|
2023-11-14 00:38:06 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${cfg.package}/bin/geary";
|
|
|
|
Type = "simple";
|
|
|
|
Restart = "always";
|
|
|
|
RestartSec = "20s";
|
|
|
|
};
|
|
|
|
};
|
2023-10-24 04:50:31 +00:00
|
|
|
};
|
2023-11-14 00:38:06 +00:00
|
|
|
|
2023-10-24 04:50:31 +00:00
|
|
|
}
|