I am currently trying to setup message filters within Thunderbird through home-manager.
As far as i could tell home-manager does not support direct configuration for this so i am trying to just write the filter file to the correct location.
The problem i’m facing is that i need the thunderbird account id to write the filter file msgFilterRules.dat
to. It is located in ~/.thunderbird/<profile-name>/ImapMail/<account-id>
My first idea was just read the home-manager config from thunderbird as the id is passed into the settings. Like in the example below:
home-manager.users.<username>.accounts = {
email = {
accounts."<email>" = {
...
thunderbird = {
enable = true;
settings = id: {
...
};
};
};
Unfortunately this is just a lambda function and i could not figure out how to get the id out of there.
My second idea was to just execute a script which returns the id as can identify the folder of the account because the inbox and custom email folders are listed in there.
echo dirname $(find /home/<username>/.thunderbird -name "<seach-term>")
But in this case i could not figure out how to use this script e.g. using runCommand to get the result to my nixos config and be able to use it.
Is this somehow possible or is there maybe an even better way to solve this problem?