Add radicale server and khal/pimsync client
This commit is contained in:
98
home/programs/calendar/default.nix
Normal file
98
home/programs/calendar/default.nix
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.khal = {
|
||||||
|
enable = true;
|
||||||
|
locale = {
|
||||||
|
timeformat = "%H:%M";
|
||||||
|
dateformat = "%m-%d";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.pimsync.enable = true;
|
||||||
|
services.pimsync.enable = true;
|
||||||
|
|
||||||
|
accounts.calendar = {
|
||||||
|
basePath = "${config.xdg.dataHome}/calendars";
|
||||||
|
accounts = {
|
||||||
|
"radicale" = {
|
||||||
|
primary = true;
|
||||||
|
primaryCollection = "personal";
|
||||||
|
|
||||||
|
local = {
|
||||||
|
type = "filesystem";
|
||||||
|
fileExt = ".ics";
|
||||||
|
};
|
||||||
|
|
||||||
|
remote = {
|
||||||
|
url = "https://radicale.jelles.net/";
|
||||||
|
type = "caldav";
|
||||||
|
userName = "kiri";
|
||||||
|
# TODO: Bitwarden
|
||||||
|
passwordCommand = [
|
||||||
|
"${pkgs.coreutils}/bin/cat"
|
||||||
|
"${config.xdg.configHome}/secrets/radicale_pass"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
khal = {
|
||||||
|
enable = true;
|
||||||
|
type = "discover";
|
||||||
|
color = "light blue";
|
||||||
|
};
|
||||||
|
|
||||||
|
pimsync = {
|
||||||
|
enable = true;
|
||||||
|
extraPairDirectives = [
|
||||||
|
{
|
||||||
|
name = "collections";
|
||||||
|
params = [ "from b" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"university" = {
|
||||||
|
remote = {
|
||||||
|
type = "http";
|
||||||
|
};
|
||||||
|
|
||||||
|
local = {
|
||||||
|
type = "filesystem";
|
||||||
|
fileExt = ".ics";
|
||||||
|
};
|
||||||
|
|
||||||
|
pimsync = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extraRemoteStorageDirectives = [
|
||||||
|
{
|
||||||
|
name = "collection_id";
|
||||||
|
params = [ "events" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "url";
|
||||||
|
children = [
|
||||||
|
{
|
||||||
|
name = "cmd";
|
||||||
|
params = [
|
||||||
|
"${pkgs.coreutils}/bin/cat"
|
||||||
|
"${config.xdg.configHome}/secrets/university_calendar_url"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
extraPairDirectives = [
|
||||||
|
{
|
||||||
|
name = "collection";
|
||||||
|
params = [ "events" ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
khal = {
|
||||||
|
enable = true;
|
||||||
|
color = "#c72125";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
../../server-modules/copyparty.nix
|
../../server-modules/copyparty.nix
|
||||||
../../server-modules/home-assistant.nix
|
../../server-modules/home-assistant.nix
|
||||||
../../server-modules/glance.nix
|
../../server-modules/glance.nix
|
||||||
|
../../server-modules/radicale.nix
|
||||||
|
|
||||||
./disk-config.nix
|
./disk-config.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
../../home/programs/thunderbird
|
../../home/programs/thunderbird
|
||||||
../../home/programs/bitwarden
|
../../home/programs/bitwarden
|
||||||
../../home/programs/nixCats
|
../../home/programs/nixCats
|
||||||
|
../../home/programs/calendar
|
||||||
#../../home/programs/zen-browser
|
#../../home/programs/zen-browser
|
||||||
|
|
||||||
# Scripts
|
# Scripts
|
||||||
|
|||||||
25
server-modules/radicale.nix
Normal file
25
server-modules/radicale.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
services.radicale = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
hosts = [ "127.0.0.1:5232" ];
|
||||||
|
};
|
||||||
|
auth = {
|
||||||
|
type = "htpasswd";
|
||||||
|
htpasswd_filename = "/var/lib/radicale/users";
|
||||||
|
htpasswd_encryption = "bcrypt";
|
||||||
|
};
|
||||||
|
storage = {
|
||||||
|
filesystem_folder = "/var/lib/radicale/collections";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.caddy.virtualHosts."radicale.jelles.net".extraConfig = ''
|
||||||
|
reverse_proxy :5232 {
|
||||||
|
header_up X-Script-Name /
|
||||||
|
header_up X-Forwarded-For {remote}
|
||||||
|
header_up X-Remote-User {http.auth.user.id}
|
||||||
|
}'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user