i have been spend 3 days on this one and cant figure out anymore where is the issue. AERC is my terminal mail client it works on my gmail and other no issues on automation part, but my 4 proton mail accounts dosent work it says no user etc basically it isint running as background.when i stop proton.mail.service manually and run protonmail-bridge –-noninteractive AERC and all accounts works as should so there is just issues on my automation and i cant see it anymmore where and what
{ pkgs, ... }: {
# 1. VPN (Wait for Network, not Graphical Session)
systemd.user.services.proton-vpn-autostart = {
Unit = {
Description = "Proton VPN Auto-Connect";
After = [ "network-online.target" ];
Wants = [ "network-online.target" ];
};
Service = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 10";
ExecStart = "${pkgs.proton-vpn-cli}/bin/protonvpn connect -f";
Restart = "on-failure";
RestartSec = "15s";
};
Install = { WantedBy = [ "default.target" ]; };
};
# 1. PROTONMAIL BRIDGE
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "Protonmail Bridge (CLI Background)";
# Wait for network and VPN
After = [ "network-online.target" "proton-vpn-autostart.service" ];
Requires = [ "proton-vpn-autostart.service" ];
};
Service = {
# Use full path and explicit flags
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge --noninteractive --no-window";
# Crucial: Give the service access to your secrets and the Nix certificate store
Environment = [
"DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus"
"PATH=${pkgs.gnome-keyring}/bin:${pkgs.libsecret}/bin:${pkgs.protonmail-bridge}/bin"
"SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
];
# Persistence settings
Restart = "always";
RestartSec = "15s";
StartLimitIntervalSec = 0;
};
Install = { WantedBy = [ "default.target" ]; };
};
# 2. AERC MONITOR
systemd.user.services.aerc-background = {
Unit = {
Description = "Aerc Background Monitor";
After = [ "protonmail-bridge.service" ];
Requires = [ "protonmail-bridge.service" ];
};
Service = {
# Increase sleep to ensure Bridge has actually bound to ports 1143/1025
ExecStartPre = "${pkgs.coreutils}/bin/sleep 15";
ExecStart = "${pkgs.aerc}/bin/aerc";
Restart = "always";
Environment = "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus";
};
Install = { WantedBy = [ "default.target" ]; };
}; # 4. TRASH CLEANUP
systemd.user.services.home-trash-cleanup = {
Unit = { Description = "Daily cleanup of user trash bin"; };
Service = {
ExecStart = "${pkgs.trash-cli}/bin/trash-empty 30";
};
Install = { WantedBy = [ "default.target" ]; };
};
}