Package: Add thunderbird.

This commit is contained in:
Dmitry Voronin 2025-01-09 17:42:06 +03:00
parent 5c952bcabc
commit 5f19ac8580
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
5 changed files with 176 additions and 37 deletions

View file

@ -11,7 +11,7 @@ let
cfg = config.home.nixos;
env = import ./env args;
file = import ./file args;
programs = import ./program args;
program = import ./program args;
in
{
imports = (util.ls <user>);
@ -34,6 +34,10 @@ in
acc
// {
${user.username} = {
accounts = import ./account args;
dconf.settings = util.catSet (util.ls ./file/dconf) args;
programs = with program; core // desktop;
xdg = import ./xdg { inherit (user) homeDirectory; };
home = {
inherit (config.const) stateVersion;
inherit (env) sessionVariables;
@ -43,9 +47,6 @@ in
# ISSUE: https://github.com/nix-community/home-manager/issues/5589
extraActivationPath = with pkgs; [ openssh ];
};
xdg = import ./xdg { inherit (user) homeDirectory; };
programs = with programs; core // desktop;
dconf.settings = util.catSet (util.ls ./file/dconf) args;
};
}
) { } cfg.users;

88
home/account/default.nix Normal file
View file

@ -0,0 +1,88 @@
{ ... }:
let
mkMail = cfg: cfg // { thunderbird.enable = true; };
mkHomeMail =
cfg:
mkMail (
cfg
// {
imap = {
host = "mail.voronind.com";
port = 993;
tls.enable = true;
};
smtp = {
host = "mail.voronind.com";
port = 465;
tls.enable = true;
};
}
);
mkHomeCalendar = {
remote = {
type = "caldav";
url = "https://dav.voronind.com";
userName = "voronind";
};
};
realName = "Dmitry Voronin";
in
{
email.accounts = {
Account = mkHomeMail {
inherit realName;
primary = true;
address = "account@voronind.com";
userName = "account@voronind.com";
};
Personal = mkHomeMail {
inherit realName;
address = "hi@voronind.com";
userName = "hi@voronind.com";
};
Admin = mkHomeMail {
inherit realName;
address = "admin@voronind.com";
userName = "admin@voronind.com";
};
Job = mkHomeMail {
inherit realName;
address = "job@voronind.com";
userName = "job@voronind.com";
};
Trash = mkHomeMail {
inherit realName;
address = "trash@voronind.com";
userName = "trash@voronind.com";
};
};
# ISSUE: https://github.com/nix-community/home-manager/issues/5775
calendar.accounts = {
default = mkHomeCalendar // {
primary = true;
};
family = mkHomeCalendar;
health = mkHomeCalendar;
high = mkHomeCalendar;
holiday = mkHomeCalendar;
low = mkHomeCalendar;
medium = mkHomeCalendar;
payment = mkHomeCalendar;
work = mkHomeCalendar;
};
# ISSUE: https://github.com/nix-community/home-manager/issues/5933
contact.accounts = {
Home = {
remote = {
type = "carddav";
url = "https://dav.voronind.com";
userName = "voronind";
};
};
};
}

View file

@ -30,5 +30,6 @@ in
desktop = {
chromium = import ./chromium args;
firefox = import ./firefox args;
thunderbird = import ./thunderbird args;
};
}

View file

@ -69,6 +69,14 @@ let
# (mkExtension "queryamoid@kaply.com" "https://github.com/mkaply/queryamoid/releases/download/v0.1/query_amo_addon_id-0.1-fx.xpi")
];
darkModeIgnore = [
"cloud.voronind.com"
"git.voronind.com"
"github.com"
"home.voronind.com"
"dav.voronind.com"
];
prefs = [
# WARN: Remove when Dark Reader policies gets merged.
(mkLockedPref "xpinstall.signatures.required" false)
@ -294,12 +302,7 @@ in
previewNewDesign = true;
syncSettings = true;
syncSitesFixes = false;
disabledFor = [
"cloud.voronind.com"
"git.voronind.com"
"github.com"
"home.voronind.com"
];
disabledFor = darkModeIgnore;
theme = {
brightness = 100;
contrast = 100;

View file

@ -0,0 +1,46 @@
{ config, lib, ... }:
{
enable = true;
profiles.default = {
isDefault = true;
withExternalGnupg = true;
};
# ISSUE: https://github.com/nix-community/home-manager/issues/5775
# ISSUE: https://github.com/nix-community/home-manager/issues/5933
# settings =
# let
# safeName = builtins.replaceStrings [ "." ] [ "-" ];
#
# calendarAccounts = lib.mapAttrsToList (n: v: { n = v; }) config.home-manager.users.voronind.accounts.calendar.accounts;
# calendars = lib.foldAttrs (
# item: acc:
# let
# calendarAccountSafeName = safeName item.name;
# in
# acc
# // {
# "calendar.registry.${calendarAccountSafeName}.cache.enabled" = true;
# "calendar.registry.${calendarAccountSafeName}.calendar-main-default" = item.primary;
# "calendar.registry.${calendarAccountSafeName}.calendar-main-in-composite" = item.primary;
# "calendar.registry.${calendarAccountSafeName}.name" = item.name;
# "calendar.registry.${calendarAccountSafeName}.type" = "caldav";
# "calendar.registry.${calendarAccountSafeName}.uri" = item.remote.url;
# "calendar.registry.${calendarAccountSafeName}.username" = item.remote.userName;
# }
# ) { } calendarAccounts;
#
# contactsAccount = config.home-manager.users.voronind.accounts.contact.accounts.Home;
# contactsAccountSafeName = safeName contactsAccount.name;
# addressBookFilename = "abook-${contactsAccountSafeName}.sqlite";
# in
# calendars
# // {
# "ldap_2.servers.${contactsAccountSafeName}.carddav.url" = contactsAccount.remote.url;
# "ldap_2.servers.${contactsAccountSafeName}.carddav.username" = contactsAccount.remote.userName;
# "ldap_2.servers.${contactsAccountSafeName}.description" = contactsAccount.name;
# "ldap_2.servers.${contactsAccountSafeName}.dirType" = 102;
# "ldap_2.servers.${contactsAccountSafeName}.filename" = addressBookFilename;
# "mail.collect_addressbook" = "jscarddav://${addressBookFilename}";
# };
}