119 lines
4.1 KiB
Nix
119 lines
4.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let globox-id = "b446944a47d39ae969ebe27f81cf2d8963df7a04dd40e31e61c7c2ecc1ac7437";
|
|
|
|
in {
|
|
home-manager.users.mysaa.accounts.email.accounts = {
|
|
"hadoly".thunderbird.enable = true;
|
|
"personal".thunderbird.enable = true;
|
|
"ens".thunderbird.enable = true;
|
|
"junk".thunderbird.enable = true;
|
|
"google".thunderbird.enable = true;
|
|
"bernard".thunderbird.enable = true;
|
|
"dmesures".thunderbird.enable = true;
|
|
"ecloud".thunderbird.enable = true;
|
|
};
|
|
home-manager.users.mysaa.programs.thunderbird = {
|
|
enable = true;
|
|
package = pkgs.thunderbird.override {
|
|
extraPolicies.ExtensionSettings = {
|
|
"localfolder@philoux.eu" = {
|
|
install_url = "https://addons.thunderbird.net/user-media/addons/_attachments/90003/localfolders-4.2.2-tb.xpi?filehash=sha256%3A71d499b55b360769447e9f08536ee557b0419e84d5914e79c18558d86a21fbd9";
|
|
installation_mode = "force_installed";
|
|
};
|
|
};
|
|
};
|
|
profiles.default = {
|
|
isDefault = true;
|
|
accountsOrder = [
|
|
"hadoly"
|
|
"dmesures"
|
|
"bernard"
|
|
"ens"
|
|
"account_${globox-id}"
|
|
"personal"
|
|
"junk"
|
|
"ecloud"
|
|
"google"
|
|
];
|
|
settings =
|
|
{
|
|
"mail.account.account_${globox-id}.server" = "server_${globox-id}";
|
|
"mail.server.server_${globox-id}.directory" = "/home/mysaa/Globox";
|
|
#user_pref("mail.server.server1.directory-rel", "[ProfD]../../../Globox");
|
|
"mail.server.server_${globox-id}.hostname" = "globox";
|
|
"mail.server.server_${globox-id}.name" = "globox";
|
|
"mail.server.server_${globox-id}.storeContractID" = "@mozilla.org/msgstore/maildirstore;1";
|
|
"mail.server.server_${globox-id}.type" = "none";
|
|
"mail.server.server_${globox-id}.userName" = "nobody";
|
|
|
|
}
|
|
// lib.attrsets.concatMapAttrs (
|
|
_: account:
|
|
lib.optionalAttrs (account.passwordCommand != null) (
|
|
let
|
|
id = builtins.hashString "sha256" account.name;
|
|
command = lib.concatStringsSep " " account.passwordCommand;
|
|
passwordScript = pkgs.writeShellScript "get-password.sh" ''
|
|
echo "Got command $1" >> /tmp/thunderpasswordget
|
|
${command} | ${pkgs.netcat}/bin/nc -w 0 -U $1
|
|
'';
|
|
in
|
|
lib.optionalAttrs (account.smtp != null) {
|
|
"mail.smtpserver.smtp_${id}.passwordCommand" = toString passwordScript;
|
|
}
|
|
// lib.optionalAttrs (account.imap != null) {
|
|
"mail.server.server_${id}.passwordCommand" = toString passwordScript;
|
|
}
|
|
)
|
|
) config.home-manager.users.mysaa.accounts.email.accounts;
|
|
};
|
|
};
|
|
|
|
# home-manager.users.mysaa.nixpkgs.overlays = [
|
|
# (final: prev: {
|
|
# thunderbird-unwrapped = prev.thunderbird-unwrapped.overrideAttrs {
|
|
# patches = (prev.thunderbird-unwrapped.patches or [ ]) ++ [
|
|
# ../../packages/add_passwordcommand_smtp.patch
|
|
# ../../packages/add_passwordcommand_imap.patch
|
|
# ];
|
|
# };
|
|
# })
|
|
# ];
|
|
/*security.pam.services.dovecot2 = {};
|
|
services.dovecot2 = {
|
|
enable = true;
|
|
enablePAM = false;
|
|
extraConfig = ''
|
|
protocols = imap
|
|
auth_mechanisms = plain login
|
|
service imap-login {
|
|
inet_listener imap {
|
|
port = 10143
|
|
address = 127.0.0.1
|
|
}
|
|
inet_listener imaps {
|
|
port = 10993
|
|
address = 127.0.0.1
|
|
}
|
|
}
|
|
log_path = /home/mysaa/.local/dovecot.log
|
|
passdb {
|
|
driver = passwd-file
|
|
args = /etc/dovecot-passwd
|
|
}
|
|
userdb {
|
|
driver = passwd
|
|
}
|
|
mail_location = maildir:/home/mysaa/Globox/:LAYOUT=fs
|
|
'';
|
|
};
|
|
environment.etc.dovecot-passwd.text = ''
|
|
mysaa:{plain}aaaaa
|
|
*/
|
|
}
|