Modularize and improve mail and calendar config
This commit is contained in:
80
home/programs/accounts/calendar.nix
Normal file
80
home/programs/accounts/calendar.nix
Normal file
@@ -0,0 +1,80 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.pimsync.enable = true;
|
||||
services.pimsync.enable = true;
|
||||
|
||||
accounts.calendar = {
|
||||
basePath = "${config.xdg.dataHome}/calendars";
|
||||
accounts = {
|
||||
"radicale" = {
|
||||
primary = true;
|
||||
primaryCollection = "personal";
|
||||
|
||||
local = {
|
||||
type = "filesystem";
|
||||
fileExt = ".ics";
|
||||
};
|
||||
|
||||
remote = {
|
||||
url = "https://radicale.jelles.net/";
|
||||
type = "caldav";
|
||||
userName = "kiri";
|
||||
# TODO: Bitwarden
|
||||
passwordCommand = [
|
||||
"${pkgs.coreutils}/bin/cat"
|
||||
config.sops.secrets.radicale_pass.path
|
||||
];
|
||||
};
|
||||
|
||||
pimsync = {
|
||||
enable = true;
|
||||
extraPairDirectives = [
|
||||
{
|
||||
name = "collections";
|
||||
params = [ "from b" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
"university" = {
|
||||
remote = {
|
||||
type = "http";
|
||||
};
|
||||
|
||||
local = {
|
||||
type = "filesystem";
|
||||
fileExt = ".ics";
|
||||
};
|
||||
|
||||
pimsync = {
|
||||
enable = true;
|
||||
|
||||
extraRemoteStorageDirectives = [
|
||||
{
|
||||
name = "collection_id";
|
||||
params = [ "events" ];
|
||||
}
|
||||
{
|
||||
name = "url";
|
||||
children = [
|
||||
{
|
||||
name = "cmd";
|
||||
params = [
|
||||
"${pkgs.coreutils}/bin/cat"
|
||||
config.sops.secrets.university_calendar_url.path
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
extraPairDirectives = [
|
||||
{
|
||||
name = "collection";
|
||||
params = [ "events" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
6
home/programs/accounts/default.nix
Normal file
6
home/programs/accounts/default.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./email.nix
|
||||
./calendar.nix
|
||||
];
|
||||
}
|
||||
87
home/programs/accounts/email.nix
Normal file
87
home/programs/accounts/email.nix
Normal file
@@ -0,0 +1,87 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
# Global enablement
|
||||
programs.mbsync.enable = true;
|
||||
programs.msmtp.enable = true;
|
||||
programs.notmuch.enable = true;
|
||||
services.mbsync.enable = true;
|
||||
|
||||
accounts.email.maildirBasePath = "${config.xdg.dataHome}/mail";
|
||||
|
||||
accounts.email.accounts = {
|
||||
main = {
|
||||
enable = true;
|
||||
primary = true;
|
||||
address = "mail@jelles.net";
|
||||
imap = {
|
||||
authentication = "plain";
|
||||
host = "taylor.mxrouting.net";
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
smtp = {
|
||||
authentication = "plain";
|
||||
host = "taylor.mxrouting.net";
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
userName = "mail@jelles.net";
|
||||
passwordCommand = "rbw get \"Main E-Mail\"";
|
||||
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
patterns = [ "*" ];
|
||||
};
|
||||
msmtp.enable = true;
|
||||
notmuch.enable = true;
|
||||
};
|
||||
|
||||
old = {
|
||||
enable = true;
|
||||
address = "mail@jellespreeuwenberg.nl";
|
||||
imap = {
|
||||
authentication = "plain";
|
||||
host = "taylor.mxrouting.net";
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
smtp = {
|
||||
authentication = "plain";
|
||||
host = "taylor.mxrouting.net";
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
userName = "mail@jellespreeuwenberg.nl";
|
||||
passwordCommand = "rbw get \"Old E-Mail\"";
|
||||
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
patterns = [ "*" ];
|
||||
};
|
||||
msmtp.enable = true;
|
||||
notmuch.enable = true;
|
||||
};
|
||||
|
||||
uni = {
|
||||
enable = true;
|
||||
flavor = "outlook.office365.com";
|
||||
address = "j.spreeuwenberg@student.tue.nl";
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
userName = "j.spreeuwenberg@student.tue.nl";
|
||||
};
|
||||
|
||||
work = {
|
||||
enable = true;
|
||||
flavor = "outlook.office365.com";
|
||||
address = "jelle.spreeuwenberg@yookr.org";
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
userName = "jelle.spreeuwenberg@yookr.org";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user