users/jan: add calendars

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-21 23:13:44 +03:00
parent 2810b9eb5c
commit 6f0a5fcc30
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
4 changed files with 29 additions and 4 deletions

View file

@ -1,11 +1,14 @@
{ config, pkgs, lib, ... }:
{ config, lib, ... }:
let
cfg = config.local.programs.calendar;
mkCalOpts = name: {
enable = lib.mkEnableOption name;
package = lib.mkPackageOption pkgs name { };
# Custom package doesn't work yet.
# See: https://github.com/nix-community/home-manager/pull/5428
# package = lib.mkPackageOption pkgs name { };
};
in
{
@ -13,6 +16,20 @@ in
khal = mkCalOpts "khal";
};
config.home.packages =
lib.optional cfg.khal.enable cfg.khal.package;
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 = {};
};
};
}

View file

@ -42,6 +42,9 @@ in
};
};
})
(final: prev: {
khal = (import inputs.nixpkgs-unstable { inherit (config.nixpkgs) system; }).khal;
})
(final: prev: {
unstable = import inputs.nixpkgs-unstable {
inherit (config.nixpkgs) config overlays system;

Binary file not shown.

View file

@ -56,6 +56,7 @@
home-manager.users.jan = {
imports = [
./email_accounts.secret.nix
./calendars.secret.nix
./git
];
@ -95,6 +96,10 @@
local.programs.file-managers.vifm.enable = lib.mkDefault true;
local.programs.aerc.enable = lib.mkDefault true;
local.programs.calendar.khal = {
enable = lib.mkDefault true;
# package = pkgs.unstable.khal;
};
local.programs.communication = {
telegram.enable = lib.mkDefault true;