Compare commits
2 Commits
e4d0326a74
...
94559de7ae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94559de7ae | ||
|
|
89fa46aa6d |
@@ -1,81 +1,98 @@
|
|||||||
{ config, lib, user, secrets, domain, ... }: let
|
{ pkgs, lib, user, secrets, domain, ... }: let
|
||||||
calendars = [
|
calendars = [
|
||||||
{
|
{
|
||||||
name = "Preservation";
|
name = "Preservation";
|
||||||
primary = true;
|
primary = true;
|
||||||
url = "https://dav.${domain}/nx2/preservation/";
|
url = "https://dav.${domain}/${user}/preservation/";
|
||||||
color = "#dddddd";
|
color = "#dddddd";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Effort";
|
name = "Effort";
|
||||||
primary = false;
|
url = "https://dav.${domain}/${user}/effort/";
|
||||||
url = "https://dav.${domain}/nx2/effort/";
|
|
||||||
color = "#dd2222";
|
color = "#dd2222";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Experience";
|
name = "Experience";
|
||||||
primary = false;
|
url = "https://dav.${domain}/${user}/experience/";
|
||||||
url = "https://dav.${domain}/nx2/experience/";
|
|
||||||
color = "#2222dd";
|
color = "#2222dd";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Exposure";
|
name = "Exposure";
|
||||||
primary = false;
|
url = "https://dav.${domain}/${user}/exposure/";
|
||||||
url = "https://dav.${domain}/nx2/exposure/";
|
|
||||||
color = "#22aa22";
|
color = "#22aa22";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Engagement";
|
name = "Engagement";
|
||||||
primary = false;
|
url = "https://dav.${domain}/${user}/engagement/";
|
||||||
url = "https://dav.${domain}/nx2/engagement/";
|
|
||||||
color = "#8800CC";
|
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 {
|
in {
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
gnome-calendar
|
||||||
|
thunderbird
|
||||||
|
];
|
||||||
|
|
||||||
accounts.calendar.accounts = let
|
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;
|
inherit primary;
|
||||||
remote = {
|
remote = {
|
||||||
type = "caldav";
|
inherit url name;
|
||||||
userName = user;
|
userName = user; # my globally set username
|
||||||
inherit url;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
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 (
|
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.list.sortOrder" = lib.fold (calendar: acc: calendar.name + " " + acc) "" 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.week.start" = 1;
|
"calendar.week.start" = 1;
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ lib.mkIf (host != "NxACE")
|
|||||||
thunderbird
|
thunderbird
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
programs.thunderbird = let
|
programs.thunderbird = let
|
||||||
inherit (lib.generators) toJSON;
|
inherit (lib.generators) toJSON;
|
||||||
extensions = toJSON {} {
|
extensions = toJSON {} {
|
||||||
@@ -41,14 +40,50 @@ lib.mkIf (host != "NxACE")
|
|||||||
"mailnews.headers.showUserAgent" = true;
|
"mailnews.headers.showUserAgent" = true;
|
||||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||||
};
|
};
|
||||||
# userChrome = with rice.color; /* css */ ''
|
userChrome = with rice.color; /* css */ ''
|
||||||
# * {
|
body,
|
||||||
# color: ${foreground} !important;
|
#navigation-toolbox,
|
||||||
# background-color: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString 0.1}) !important;
|
#calendarContent,
|
||||||
# border: none !important;
|
#calSidebar,
|
||||||
# -moz-appearance: none !important;
|
#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;
|
||||||
|
}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
5
system-modules/calendar.nix
Normal file
5
system-modules/calendar.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
programs.dconf.enable = true;
|
||||||
|
services.gnome.evolution-data-server.enable = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user