feat: add more mail accounts to thunderbird

This commit is contained in:
oddlama 2024-01-30 21:33:17 +01:00
parent 498cf29a70
commit f8c7193bd6
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
3 changed files with 10 additions and 30 deletions

View file

@ -28,12 +28,6 @@ in
mode = "640";
};
age.secrets.mailpw-206fd3b8 = {
rekeyFile = ./secrets/mailpw-206fd3b8.age;
group = myuser;
mode = "640";
};
home-manager.users.${myuser} = {
imports = [
../modules

View file

@ -1,31 +1,17 @@
{
config,
lib,
nixosConfig,
pkgs,
...
}: let
rageWrapper = pkgs.writeShellScript "rage-decrypt-yubikey" ''
export PATH="${pkgs.age-plugin-yubikey}:$PATH"
exec ${pkgs.rage}/bin/rage
'';
in {
accounts.email.accounts =
lib.flip lib.mapAttrs' config.userSecrets.accounts.email
(_n: v:
lib.nameValuePair v.address ({
# TODO genericize
passwordCommand =
[rageWrapper.out "-d"]
++ lib.concatMap (x: ["-i" x]) nixosConfig.age.rekey.masterIdentities
++ [nixosConfig.age.secrets.mailpw-206fd3b8.path];
thunderbird = {
enable = true;
profiles = ["personal"];
};
}
// v));
}: {
accounts.email.accounts = lib.flip lib.mapAttrs' config.userSecrets.accounts.email (_n: v:
lib.nameValuePair v.address (
lib.recursiveUpdate v {
thunderbird = {
enable = true;
profiles = ["personal"];
};
}
));
programs.thunderbird = {
enable = true;

Binary file not shown.