nixpkgs/home/modules/programs/vdirsyncer.nix
Daniel Siepmann cc3fcb3d50
Add vdirsync and khal with small notification script
Very basic, but maybe better then all the shiny none working solutions.
Will sync all calendars to vdir.
khal is able to parse and show them. khal also offers an cli interface
to fetch events for a certain time.

Properly use keepass xc via secret tool as command line tool
Enable keepassxc usage as secret tool.
Remove crypted file as this no longer keeps passwords

Remove korganizer as it doesn't provide notifications, try khal
2022-10-06 09:27:38 +02:00

61 lines
1.5 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.vdirsyncer;
in {
options.programs.vdirsyncer = {
enable = mkEnableOption "vdirsyncer";
package = mkOption {
type = types.package;
default = pkgs.vdirsyncer;
description = "vdirsyncer package to install.";
};
frequency = mkOption {
type = types.str;
default = "*:0/15";
example = "hourly";
description = ''
The sync frequency.
Check <literal>man systemd.time</literal> for more information on the syntax.
'';
};
configuration = mkOption {
type = types.str;
default = "";
description = ''
The content of the configuration file.
See:
- https://vdirsyncer.pimutils.org/en/stable/tutorial.html#configuration
- https://github.com/pimutils/vdirsyncer/blob/main/config.example
'';
};
};
config = mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."vdirsyncer/config".text = cfg.configuration;
systemd.user.services.vdirsyncer = {
Unit = { Description = "vdirsyncer synchronisation"; };
Service = { ExecStart = "${pkgs.vdirsyncer}/bin/vdirsyncer sync"; };
};
systemd.user.timers.vdirsyncer = {
Unit = { Description = "vdirsyncer synchronisation"; };
Timer = {
OnBootSec = "15min";
OnCalendar = "${cfg.frequency}";
Persistent = true;
Unit = "vdirsyncer.service";
};
Install = { WantedBy = [ "timers.target" ]; };
};
};
}