Only make systemd services if mbsync for account is enabled

This commit is contained in:
Evie Litherland-Smith 2023-10-01 09:20:15 +01:00
parent 069bf62ca4
commit 55a6c3c281

View file

@ -150,24 +150,25 @@
}; };
}; };
systemd.user.services = { systemd.user.services = {
protonmail-bridge = { protonmail-bridge =
Unit = { lib.mkIf config.accounts.email.accounts.proton.mbsync.enable {
Description = "Protonmail Bridge"; Unit = {
After = [ "network.target" ]; Description = "Protonmail Bridge";
After = [ "network.target" ];
};
Service = {
Restart = "always";
# Environment = "PATH=${pkgs.libsecret}/bin";
ExecStart =
"${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive --log-level info";
};
Install.WantedBy = [
"graphical-session.target"
"mbsync.service"
"imapnotify-proton.service"
];
}; };
Service = { davmail = lib.mkIf config.accounts.email.accounts.ukaea.mbsync.enable {
Restart = "always";
# Environment = "PATH=${pkgs.libsecret}/bin";
ExecStart =
"${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive --log-level info";
};
Install.WantedBy = [
"graphical-session.target"
"mbsync.service"
"imapnotify-proton.service"
];
};
davmail = {
Unit = { Unit = {
Description = "DavMail"; Description = "DavMail";
After = [ "network.target" ]; After = [ "network.target" ];