Make more account activation dependency links

Link more calendar/contact accounts with relevant email
Link services to expressions required

Disable ukaea email by default, enable on work laptop
This commit is contained in:
Evie Litherland-Smith 2023-10-03 07:59:00 +01:00
parent b2a27457fe
commit 6c63148774
4 changed files with 80 additions and 83 deletions

View file

@ -8,14 +8,16 @@
services.vdirsyncer.enable = true;
accounts.calendar = {
basePath = ".calendar";
accounts = {
nextcloud = {
primary = lib.mkDefault true;
primaryCollection = "Personal";
accounts = let
local = {
type = "filesystem";
fileExt = ".ics";
};
in {
nextcloud = rec {
inherit local;
primary = lib.mkDefault true;
primaryCollection = "Personal";
remote = {
type = "caldav";
url = "https://cloud.xenia.me.uk/remote.php/dav";
@ -33,30 +35,27 @@
metadata = [ "color" "displayname" ];
};
khal = {
enable = lib.mkDefault true;
inherit (vdirsyncer) enable;
type = "discover";
};
};
ukaea = {
ukaea = let emailConfig = config.accounts.email.accounts.ukaea;
in rec {
inherit local;
primaryCollection = "Calendar";
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = rec {
inherit (config.accounts.email.accounts.ukaea)
userName passwordCommand;
inherit (emailConfig) userName passwordCommand;
type = "caldav";
url = "http://localhost:1080/users/${userName}/calendar/";
};
vdirsyncer = {
enable = lib.mkDefault true;
enable = lib.mkDefault emailConfig.mbsync.enable;
collections = [ "from a" ];
metadata = [ "color" "displayname" ];
itemTypes = [ "VEVENT" ];
};
khal = {
enable = lib.mkDefault true;
inherit (vdirsyncer) enable;
type = "discover";
};
};

View file

@ -5,37 +5,35 @@
programs.vdirsyncer.enable = true;
accounts.contact = {
basePath = ".contact";
accounts = {
nextcloud = {
accounts = let
calendarAccounts = config.accounts.calendar.accounts;
local = {
type = "filesystem";
fileExt = ".vcf";
};
in {
nextcloud = {
inherit local;
remote = {
inherit (config.accounts.calendar.accounts.nextcloud.remote)
userName passwordCommand;
inherit (calendarAccounts.nextcloud.remote) userName passwordCommand;
type = "carddav";
url =
"https://cloud.xenia.me.uk/remote.php/dav/addressbooks/users/xenia/contacts-1/";
};
vdirsyncer = {
enable = lib.mkDefault true;
inherit (calendarAccounts.nextcloud.vdirsyncer) enable;
collections = [ "from a" ];
};
};
ukaea = {
local = {
type = "filesystem";
fileExt = ".vcf";
};
inherit local;
remote = rec {
inherit (config.accounts.calendar.accounts.ukaea.remote)
userName passwordCommand;
inherit (calendarAccounts.ukaea.remote) userName passwordCommand;
type = "carddav";
url = "http://localhost:1080/users/${userName}/contacts/";
};
vdirsyncer = {
enable = lib.mkDefault true;
inherit (calendarAccounts.ukaea.vdirsyncer) enable;
collections = [ "from a" ];
};
};

View file

@ -107,7 +107,7 @@
ukaea = let
host = "127.0.0.1";
tls.enable = false;
accountEnabled = true;
accountEnabled = false;
in rec {
inherit realName;
primary = lib.mkDefault false;
@ -156,17 +156,17 @@
};
};
};
systemd.user.services = {
imapnotify-proton.Unit = {
systemd.user.services = let emailAccounts = config.accounts.email.accounts;
in {
imapnotify-proton.Unit = lib.mkIf emailAccounts.proton.imapnotify.enable {
Wants = [ "protonmail-bridge.service" ];
After = [ "protonmail-bridge.service" ];
};
imapnotify-ukaea.Unit = {
imapnotify-ukaea.Unit = lib.mkIf emailAccounts.ukaea.imapnotify.enable {
Wants = [ "davmail.service" ];
After = [ "davmail.service" ];
};
protonmail-bridge =
lib.mkIf config.accounts.email.accounts.proton.mbsync.enable {
protonmail-bridge = lib.mkIf emailAccounts.proton.mbsync.enable {
Unit = {
Description = "Podman container-protonmail-bridge.service";
Documentation = [ "man:podman-generate-systemd(1)" ];
@ -205,7 +205,7 @@
};
Install.WantedBy = [ "default.target" ];
};
davmail = lib.mkIf config.accounts.email.accounts.ukaea.mbsync.enable {
davmail = lib.mkIf emailAccounts.ukaea.mbsync.enable {
Unit = {
Description = "Davmail server";
Wants = [ "network-online.target" "graphical-session.target" ];

View file

@ -24,15 +24,15 @@
accounts = {
email.accounts = {
proton.primary = false;
ukaea.primary = true;
ukaea = {
primary = true;
imapnotify.enable = true;
mbsync.enable = true;
msmtp.enable = true;
mu.enable = true;
};
calendar.accounts.nextcloud = {
vdirsyncer.enable = false; # TEMP until fixed
khal.enable = false; # TEMP until fixed
};
contact.accounts.nextcloud = {
vdirsyncer.enable = false; # TEMP until fixed
};
calendar.accounts.nextcloud.vdirsyncer.enable = false; # TEMP until fixed
};
services.vdirsyncer.enable = lib.mkForce false; # TEMP until fixed
services.kanshi.profiles = {