feat: add repo-like user secrets, rudimentary config of thunderbird

This commit is contained in:
oddlama 2023-09-16 14:04:02 +02:00
parent 0994bba279
commit 926787528b
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
10 changed files with 115 additions and 3 deletions

View file

@ -0,0 +1,53 @@
{
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));
# TODO dont send html setting
programs.thunderbird = {
enable = true;
profiles.personal = {
isDefault = true;
withExternalGnupg = true;
};
};
home.persistence."/state".directories = [
".cache/thunderbird"
];
home.persistence."/persist".directories = [
".thunderbird"
];
xdg.mimeApps.defaultApplications = {
"x-scheme-handler/mailto" = ["thunderbird.desktop"];
"message/rfc822" = ["thunderbird.desktop"];
};
}