modules/calendar: move khal to the calendar folder

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-22 17:52:06 +03:00
parent 9c969a30a0
commit 7d369ef34c
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
5 changed files with 34 additions and 39 deletions

View file

@ -1,35 +0,0 @@
{ config, lib, ... }:
let
cfg = config.local.programs.calendar;
mkCalOpts = name: {
enable = lib.mkEnableOption name;
# 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";
};
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

@ -0,0 +1,6 @@
{ config, ...}:
{
imports = [./khal.nix];
config.accounts.calendar.basePath = "${config.xdg.dataHome}/calendars";
}

View file

@ -0,0 +1,27 @@
{ config, lib, ... }:
let cfg = config.local.programs.calendar; in
{
options.local.programs.calendar.khal = {
enable = lib.mkEnableOption "khal";
# Custom package doesn't work yet.
# See: https://github.com/nix-community/home-manager/pull/5428
# package = lib.mkPackageOption pkgs "khal" { };
};
config = {
programs.khal = lib.mkIf cfg.khal.enable {
enable = true;
locale = rec {
timeformat = "%H:%M";
dateformat = "%d.%m.";
longdateformat = "%d.%m.%Y";
datetimeformat = "${dateformat} ${timeformat}";
longdatetimeformat = "${longdateformat} ${timeformat}";
};
# See: https://khal.readthedocs.io/en/latest/configure.html
settings = { };
};
};
}

View file

@ -3,12 +3,12 @@
{ {
imports = [ imports = [
./aerc.nix ./aerc.nix
./calendar.nix
./communication.nix ./communication.nix
./dev-tools.nix ./dev-tools.nix
./flameshot.nix ./flameshot.nix
./libreoffice.nix ./libreoffice.nix
./share-files.nix ./share-files.nix
./calendar
./editors ./editors
./file-managers ./file-managers
./terminals ./terminals

View file

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