Compare commits

...

2 Commits

Author SHA1 Message Date
Lennart J. Kurzweg (Nx2)
94559de7ae better thunderbird css 2025-01-19 11:43:24 +01:00
Lennart J. Kurzweg (Nx2)
89fa46aa6d calendar ++ 2025-01-19 11:43:15 +01:00
3 changed files with 115 additions and 58 deletions

View File

@@ -1,81 +1,98 @@
{ config, lib, user, secrets, domain, ... }: let
{ pkgs, lib, user, secrets, domain, ... }: let
calendars = [
{
name = "Preservation";
primary = true;
url = "https://dav.${domain}/nx2/preservation/";
url = "https://dav.${domain}/${user}/preservation/";
color = "#dddddd";
}
{
name = "Effort";
primary = false;
url = "https://dav.${domain}/nx2/effort/";
url = "https://dav.${domain}/${user}/effort/";
color = "#dd2222";
}
{
name = "Experience";
primary = false;
url = "https://dav.${domain}/nx2/experience/";
url = "https://dav.${domain}/${user}/experience/";
color = "#2222dd";
}
{
name = "Exposure";
primary = false;
url = "https://dav.${domain}/nx2/exposure/";
url = "https://dav.${domain}/${user}/exposure/";
color = "#22aa22";
}
{
name = "Engagement";
primary = false;
url = "https://dav.${domain}/nx2/engagement/";
url = "https://dav.${domain}/${user}/engagement/";
color = "#8800CC";
}
{
name = "Sleep as Android";
url = secrets.calendar.sleep-as-android-url;
color = "#111111";
read-only = true;
type = "ics";
}
{
name = "LEC";
url = "https://zlypher.github.io/lol-events/cal/league-of-legends-lec.ical";
color = "#A87000";
read-only = true;
type = "ics";
}
{
name = "Handball Männer";
url = "http://i.cal.to/ical/108/dhb/handball-nationalmannschaft/c687e97f.bc7c3eb6-11a0e356.ics";
color = "#880023";
read-only = true;
type = "ics";
}
];
default_set = {
# name =
# url =
color = "#777777";
read-only = false;
primary = false;
type = "caldav";
};
in {
home.packages = with pkgs; [
gnome-calendar
thunderbird
];
accounts.calendar.accounts = let
makeCalendar = url: primary: color: {
transform_caledar_set = calendar_set: with calendar_set; { # transform set for accounts.calendar.accounts endpoint
inherit primary;
remote = {
type = "caldav";
userName = user;
inherit url;
inherit url name;
userName = user; # my globally set username
};
};
m = cc: lib.attrsets.mergeAttrsList ( map (c: { "${c.name}" = makeCalendar c.url c.primary c.color;}) cc );
in m calendars;
# TODO: Replace this once https://github.com/nix-community/home-manager/pull/5484 is merged.
# Make sure it works, though, including the order of calendars.
programs.thunderbird.settings = let
makeThunderbirdCalendar = cal: let
calendarAccountSafeName = (builtins.replaceStrings ["."] ["-"]) cal.name;
in {
"calendar.registry.${calendarAccountSafeName}.cache.enabled" = true;
"calendar.registry.${calendarAccountSafeName}.calendar-main-default" = cal.primary;
"calendar.registry.${calendarAccountSafeName}.calendar-main-in-composite" = true;
"calendar.registry.${calendarAccountSafeName}.color" = cal.color;
"calendar.registry.${calendarAccountSafeName}.name" = cal.name;
"calendar.registry.${calendarAccountSafeName}.type" = "caldav";
"calendar.registry.${calendarAccountSafeName}.uri" = config.accounts.calendar.accounts.${cal.name}.remote.url;
"calendar.registry.${calendarAccountSafeName}.username" = config.accounts.calendar.accounts.${cal.name}.remote.userName;
};
in lib.attrsets.mergeAttrsList (
map (cal: makeThunderbirdCalendar cal) calendars
map (calendar: {
"${calendar.name}" = transform_caledar_set ( default_set // calendar );
}) calendars
);
programs.thunderbird.settings = let
to_safe_name = name: (builtins.replaceStrings ["."] ["-"]) name;
in (lib.attrsets.mergeAttrsList (
map (calendar: with ( default_set // calendar ); {
"calendar.registry.${to_safe_name calendar.name}.cache.enabled" = true;
"calendar.registry.${to_safe_name calendar.name}.calendar-main-default" = primary;
"calendar.registry.${to_safe_name calendar.name}.calendar-main-in-composite" = true;
"calendar.registry.${to_safe_name calendar.name}.color" = color;
"calendar.registry.${to_safe_name calendar.name}.name" = name;
"calendar.registry.${to_safe_name calendar.name}.type" = type;
"calendar.registry.${to_safe_name calendar.name}.uri" = url;
"calendar.registry.${to_safe_name calendar.name}.username" = user;
"calendar.registry.${to_safe_name calendar.name}.readOnly" = read-only;
}) calendars
) // {
"calendar.registry.sleep-as-android.cache.enabled" = true;
"calendar.registry.sleep-as-android.calendar-main-in-composite" = true;
"calendar.registry.sleep-as-android.color" = "#222233";
"calendar.registry.sleep-as-android.name" = "Sleep As Android";
"calendar.registry.sleep-as-android.type" = "ics";
"calendar.registry.sleep-as-android.readOnly" = true;
"calendar.registry.sleep-as-android.uri" = secrets.calendar.sleep-as-android-url;
"calendar.list.sortOrder" = lib.fold (cal: acc: cal.name + " " + acc) "" calendars;
# Keep these after removing the above.
"calendar.list.sortOrder" = lib.fold (calendar: acc: calendar.name + " " + acc) "" calendars;
"calendar.week.start" = 1;
};
});
}

View File

@@ -5,7 +5,6 @@ lib.mkIf (host != "NxACE")
thunderbird
];
programs.thunderbird = let
inherit (lib.generators) toJSON;
extensions = toJSON {} {
@@ -41,20 +40,56 @@ lib.mkIf (host != "NxACE")
"mailnews.headers.showUserAgent" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
# userChrome = with rice.color; /* css */ ''
# * {
# color: ${foreground} !important;
# background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString 0.1}) !important;
# border: none !important;
# -moz-appearance: none !important;
# }
# '';
userChrome = with rice.color; /* css */ ''
body,
#navigation-toolbox,
#calendarContent,
#calSidebar,
#tabpanelcontainer,
#spacesToolbar,
#tabs-toolbar,
#calMinimonth,
#primaryButtonSidePanel *,
.minimonth-week,
.multiday-header-corner, .day-column-heading, calendar-header-container, calendar-event-column, .multiday-hour-box,
#view-box,
#tabs-toolbar,
#status-bar,
.calview-toggle,
#calview-toggle-item,
#folderPaneHeaderBar,
#folderPane,
#threadPaneHeaderBar,
#threadTree,
#tabs-toolbar {
color: ${foreground} !important;
font-family: ${rice.font.base.name} !important;
background-color: transparent !important;
background-image: none !important;
border: none !important;
-moz-appearance: none !important;
}
.minimonth-nav-section {
background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency}) !important;
border: ${builtins.toString rice.border-width}px solid ${border};
}
.button,
.button-primary,
.tab-content[selected] {
background-color: ${accent.base};
color: ${background};
background-image: none;
}
html {
background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency}) !important;
}
'';
};
};
};
accounts.email.accounts = let
accounts.email.accounts = let
OAuth2Settings = id: {
"mail.smtpserver.smtp_${id}.authMethod" = 10;
"mail.server.server_${id}.authMethod" = 10;

View File

@@ -0,0 +1,5 @@
{ ... }:
{
programs.dconf.enable = true;
services.gnome.evolution-data-server.enable = true;
}