1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 15:09:46 +01:00
home-manager/tests/modules/programs/khal/config.nix
O. C. Taskin 782eed8bb6
programs.khal: add "addresses" option + tidy up (#5221)
- Add `accounts.<calendar|contact>.accounts.<name>.khal.addresses`
  option to enable new configuration option, "addresses", from khal,
  which is used for showing participation status [1].
- Remove mistaken new line in khal implementation, refer to [2].
- Make additions to the existing test case to check the new addresses
  feature. And remove the empty lines in expected configs.

[1]: https://khal.readthedocs.io/en/latest/configure.html#the-calendars-section
[2]: https://github.com/nix-community/home-manager/pull/5192#pullrequestreview-1975091763
2024-04-05 13:48:20 +02:00

101 lines
2.3 KiB
Nix

{ ... }:
{
programs.khal = {
enable = true;
settings = {
default.timedelta = "5d";
view.agenda_event_format =
"{calendar-color}{cancelled}{start-end-time-style} {title}{repeat-symbol}{reset}";
};
};
accounts.calendar = {
basePath = "$XDG_CONFIG_HOME/cal";
accounts = {
test = {
primary = true;
primaryCollection = "test";
khal = {
enable = true;
readOnly = true;
color = "#ff0000";
type = "calendar";
};
local.type = "filesystem";
local.fileExt = ".ics";
name = "test";
remote = {
type = "http";
url = "https://example.com/events.ical";
};
};
testWithAddresss = {
khal = {
enable = true;
addresses = [ "john.doe@email.com" ];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = {
type = "http";
url = "https://example.com/events.ical";
};
};
testWithMultipleAddresss = {
khal = {
enable = true;
addresses = [ "john.doe@email.com" "another.brick@on.the.wall" ];
};
local = {
type = "filesystem";
fileExt = ".ics";
};
remote = {
type = "http";
url = "https://example.com/events.ical";
};
};
};
};
accounts.contact = {
basePath = "$XDG_CONFIG_HOME/card";
accounts = {
testcontacts = {
khal = {
enable = true;
collections = [ "default" "automaticallyCollected" ];
};
local.type = "filesystem";
local.fileExt = ".vcf";
name = "testcontacts";
remote = {
type = "http";
url = "https://example.com/contacts.vcf";
};
};
testcontactsNoCollections = {
khal.enable = true;
local.type = "filesystem";
local.fileExt = ".vcf";
name = "testcontactsNoCollections";
remote = {
type = "http";
url = "https://example.com/contacts.vcf";
};
};
};
};
test.stubs = { khal = { }; };
nmt.script = ''
configFile=home-files/.config/khal/config
assertFileExists $configFile
assertFileContent $configFile ${./khal-config-expected}
'';
}