system/modules/home-manager/programs/calendar.nix

36 lines
852 B
Nix
Raw Normal View History

2024-05-21 23:13:44 +03:00
{ config, lib, ... }:
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 { };
};
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 = {};
};
};
}