2024-05-21 23:13:44 +03:00
|
|
|
{ config, lib, ... }:
|
2024-05-21 19:10:20 +03:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.local.programs.calendar;
|
|
|
|
|
|
|
|
mkCalOpts = name: {
|
|
|
|
enable = lib.mkEnableOption name;
|
2024-05-21 23:13:44 +03:00
|
|
|
|
|
|
|
# Custom package doesn't work yet.
|
|
|
|
# See: https://github.com/nix-community/home-manager/pull/5428
|
|
|
|
# package = lib.mkPackageOption pkgs name { };
|
2024-05-21 19:10:20 +03:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.local.programs.calendar = {
|
|
|
|
khal = mkCalOpts "khal";
|
|
|
|
};
|
|
|
|
|
2024-05-21 23:13:44 +03:00
|
|
|
config = {
|
|
|
|
accounts.calendar.basePath = "${config.xdg.dataHome}/calendars";
|
|
|
|
|
|
|
|
programs.khal = lib.mkIf cfg.khal.enable {
|
|
|
|
enable = true;
|
|
|
|
locale = rec {
|
|
|
|
timeformat = "%H:%M";
|
|
|
|
dateformat = "%Y-%m-%d";
|
|
|
|
longdateformat = dateformat;
|
|
|
|
datetimeformat = "${dateformat} ${timeformat}";
|
|
|
|
longdatetimeformat = datetimeformat;
|
|
|
|
};
|
|
|
|
# See: https://khal.readthedocs.io/en/latest/configure.html
|
|
|
|
settings = {};
|
|
|
|
};
|
|
|
|
};
|
2024-05-21 19:10:20 +03:00
|
|
|
}
|