2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
2021-04-07 20:10:48 +02:00
|
|
|
davHome = "~/.local/share/dav";
|
2021-10-26 20:39:17 +02:00
|
|
|
kmeinCloud = {
|
2021-12-11 09:45:25 +01:00
|
|
|
davEndpoint = "https://cloud.xn--kiern-0qa.de/remote.php/dav";
|
2021-10-26 20:39:17 +02:00
|
|
|
username = "kieran";
|
|
|
|
|
password = lib.fileContents <secrets/nextcloud/password>;
|
|
|
|
|
};
|
|
|
|
|
fysiCloud = {
|
|
|
|
|
davEndpoint = "https://nextcloud.fysi.dev/remote.php/dav";
|
|
|
|
|
username = "kmein";
|
|
|
|
|
password = lib.fileContents <secrets/nextcloud-fysi/password>;
|
|
|
|
|
};
|
2022-03-10 21:52:12 +01:00
|
|
|
in {
|
2022-09-12 12:36:14 +02:00
|
|
|
environment.systemPackages = [
|
|
|
|
|
pkgs.khal
|
|
|
|
|
pkgs.vdirsyncer
|
|
|
|
|
pkgs.khard
|
|
|
|
|
pkgs.todoman
|
|
|
|
|
(pkgs.writers.writeDashBin "todo-procrastinate" ''
|
|
|
|
|
[ $# -eq 1 ] || {
|
|
|
|
|
echo "Usage: $0 TODO_ID" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
2022-09-13 21:01:32 +02:00
|
|
|
todo_id=$1
|
|
|
|
|
new_timestamp=$(${pkgs.todoman}/bin/todo --porcelain show "$todo_id" | ${pkgs.jq}/bin/jq '.due + 24 * 60 * 60')
|
|
|
|
|
new_date=$(${pkgs.coreutils}/bin/date +"%Y-%m-%d %H:%M" -d "@$new_timestamp")
|
|
|
|
|
${pkgs.todoman}/bin/todo edit "$todo_id" --due "$new_date"
|
2022-09-12 12:36:14 +02:00
|
|
|
'')
|
|
|
|
|
];
|
2021-04-07 22:39:01 +02:00
|
|
|
|
|
|
|
|
systemd.user.services.vdirsyncer = {
|
|
|
|
|
enable = true;
|
2022-03-10 21:52:12 +01:00
|
|
|
wants = ["network-online.target"];
|
|
|
|
|
wantedBy = ["default.target"];
|
2021-04-07 22:39:01 +02:00
|
|
|
startAt = "*:00/10";
|
|
|
|
|
script = ''
|
|
|
|
|
${pkgs.vdirsyncer}/bin/vdirsyncer sync
|
|
|
|
|
${pkgs.khal}/bin/khal printcalendars # https://lostpackets.de/khal/configure.html#syncing
|
|
|
|
|
'';
|
2021-10-18 07:24:43 +02:00
|
|
|
serviceConfig = {
|
|
|
|
|
Type = "oneshot";
|
|
|
|
|
Restart = "on-failure";
|
|
|
|
|
};
|
2021-04-07 22:39:01 +02:00
|
|
|
};
|
2021-04-07 20:10:48 +02:00
|
|
|
|
|
|
|
|
home-manager.users.me = {
|
|
|
|
|
xdg.configFile = {
|
2021-04-07 22:39:01 +02:00
|
|
|
"khard/khard.conf".text = ''
|
|
|
|
|
[addressbooks]
|
|
|
|
|
[[contacts]]
|
|
|
|
|
path = ${davHome}/contacts/contacts/
|
|
|
|
|
|
|
|
|
|
[general]
|
|
|
|
|
debug = no
|
|
|
|
|
default_action = list
|
|
|
|
|
editor = ${config.environment.variables.EDITOR}
|
|
|
|
|
merge_editor = ${pkgs.vim}/bin/vimdiff
|
|
|
|
|
|
|
|
|
|
[contact table]
|
|
|
|
|
display = first_name
|
|
|
|
|
group_by_addressbook = no
|
|
|
|
|
reverse = no
|
|
|
|
|
show_nicknames = no
|
|
|
|
|
show_uids = no
|
|
|
|
|
sort = last_name
|
|
|
|
|
localize_dates = yes
|
|
|
|
|
preferred_phone_number_type = pref, cell, home
|
|
|
|
|
preferred_email_address_type = pref, work, home
|
|
|
|
|
|
|
|
|
|
[vcard]
|
|
|
|
|
search_in_source_files = no
|
|
|
|
|
skip_unparsable = no
|
|
|
|
|
'';
|
|
|
|
|
|
2021-12-06 13:53:42 +01:00
|
|
|
"todoman/config.py".text = ''
|
|
|
|
|
path = "${davHome}/calendar/*"
|
|
|
|
|
date_format = "%Y-%m-%d"
|
|
|
|
|
time_format = "%H:%M"
|
2021-04-12 18:18:28 +02:00
|
|
|
default_due = 0
|
2021-12-06 13:53:42 +01:00
|
|
|
default_list = "Personal"
|
2021-04-12 18:18:28 +02:00
|
|
|
startable = True
|
|
|
|
|
'';
|
|
|
|
|
|
2021-04-07 20:10:48 +02:00
|
|
|
"khal/config".text = ''
|
|
|
|
|
[calendars]
|
|
|
|
|
|
2021-10-26 20:39:17 +02:00
|
|
|
[[alew]]
|
|
|
|
|
path = ${davHome}/calendar/alew
|
|
|
|
|
color = "light gray"
|
|
|
|
|
|
|
|
|
|
[[personal]]
|
|
|
|
|
path = ${davHome}/calendar/personal
|
|
|
|
|
color = "light cyan"
|
|
|
|
|
|
|
|
|
|
[[uni]]
|
|
|
|
|
path = ${davHome}/calendar/uni-1
|
|
|
|
|
color = "yellow"
|
|
|
|
|
|
|
|
|
|
[[fysi]]
|
|
|
|
|
path = ${davHome}/calendar/fysi-1
|
|
|
|
|
color = "light magenta"
|
|
|
|
|
|
|
|
|
|
[[fysi_team]]
|
|
|
|
|
path = ${davHome}/calendar/personal_shared_by_fdf
|
|
|
|
|
color = "light red"
|
|
|
|
|
|
|
|
|
|
[[birthdays]]
|
|
|
|
|
path = ${davHome}/contacts/contacts
|
|
|
|
|
type = birthdays
|
|
|
|
|
color = "light green"
|
2021-04-07 20:10:48 +02:00
|
|
|
|
|
|
|
|
[default]
|
|
|
|
|
highlight_event_days = True
|
|
|
|
|
timedelta = 5d
|
2021-11-24 08:12:04 +01:00
|
|
|
print_new = path
|
|
|
|
|
default_calendar = personal
|
2021-04-07 20:10:48 +02:00
|
|
|
|
|
|
|
|
[locale]
|
2021-04-17 09:26:48 +02:00
|
|
|
timeformat = %H:%M
|
|
|
|
|
dateformat = %Y-%m-%d
|
|
|
|
|
longdateformat = %Y-%m-%d
|
|
|
|
|
datetimeformat = %Y-%m-%d %H:%M
|
|
|
|
|
longdatetimeformat = %Y-%m-%d %H:%M
|
2021-04-07 20:10:48 +02:00
|
|
|
local_timezone = ${config.time.timeZone}
|
|
|
|
|
default_timezone = ${config.time.timeZone}
|
|
|
|
|
weeknumbers = left
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
"vdirsyncer/config".text = ''
|
|
|
|
|
[general]
|
|
|
|
|
status_path = "~/.local/share/vdirsyncer/status/"
|
|
|
|
|
|
|
|
|
|
[pair kontakte]
|
|
|
|
|
a = "kontakte_local"
|
|
|
|
|
b = "kontakte_cloud"
|
2021-04-08 11:58:25 +02:00
|
|
|
collections = ["contacts"]
|
2021-04-07 22:39:01 +02:00
|
|
|
conflict_resolution = "b wins"
|
|
|
|
|
|
|
|
|
|
[pair kalender]
|
|
|
|
|
a = "kalender_local"
|
|
|
|
|
b = "kalender_cloud"
|
2021-10-26 20:39:17 +02:00
|
|
|
collections = ["personal", "alew", "uni-1"]
|
|
|
|
|
conflict_resolution = "b wins"
|
|
|
|
|
|
|
|
|
|
[pair fysi]
|
|
|
|
|
a = "kalender_local"
|
|
|
|
|
b = "fysi_cloud"
|
|
|
|
|
collections = ["fysi-1", "personal_shared_by_fdf"]
|
2021-04-07 22:39:01 +02:00
|
|
|
conflict_resolution = "b wins"
|
2021-04-07 20:10:48 +02:00
|
|
|
|
|
|
|
|
[storage kontakte_local]
|
|
|
|
|
type = "filesystem"
|
|
|
|
|
path = "${davHome}/contacts/"
|
|
|
|
|
fileext = ".vcf"
|
|
|
|
|
|
2021-04-07 22:39:01 +02:00
|
|
|
[storage kalender_local]
|
|
|
|
|
type = "filesystem"
|
|
|
|
|
path = "${davHome}/calendar/"
|
|
|
|
|
fileext = ".ics"
|
|
|
|
|
|
2021-04-07 20:10:48 +02:00
|
|
|
[storage kontakte_cloud]
|
|
|
|
|
type = "carddav"
|
2021-10-26 20:39:17 +02:00
|
|
|
url = "${kmeinCloud.davEndpoint}/addressbooks/users/${kmeinCloud.username}/"
|
|
|
|
|
username = "${kmeinCloud.username}"
|
|
|
|
|
password = "${kmeinCloud.password}"
|
2021-04-07 20:10:48 +02:00
|
|
|
|
|
|
|
|
[storage kalender_cloud]
|
|
|
|
|
type = "caldav"
|
2021-10-26 20:39:17 +02:00
|
|
|
url = "${kmeinCloud.davEndpoint}/calendars/${kmeinCloud.username}/"
|
|
|
|
|
username = "${kmeinCloud.username}"
|
|
|
|
|
password = "${kmeinCloud.password}"
|
|
|
|
|
|
|
|
|
|
[storage fysi_cloud]
|
|
|
|
|
type = "caldav"
|
|
|
|
|
url = "${fysiCloud.davEndpoint}/calendars/${fysiCloud.username}/"
|
|
|
|
|
username = "${fysiCloud.username}"
|
|
|
|
|
password = "${fysiCloud.password}"
|
2021-04-07 20:10:48 +02:00
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|