mirror of
https://github.com/nix-community/home-manager
synced 2024-11-19 17:49:45 +01:00
programs.khal
moved highlight_event_days where appropriated and added tests
This commit is contained in:
parent
d895a77448
commit
4a26e21030
5 changed files with 36 additions and 2 deletions
|
@ -12,7 +12,7 @@ let
|
||||||
path = mkOption {
|
path = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "${cfg.basePath}/${name}";
|
default = "${cfg.basePath}/${name}";
|
||||||
defaultText = "‹accounts.contact.basePath›/‹name›";
|
defaultText = "‹accounts.calendar.basePath›/‹name›";
|
||||||
description = "The path of the storage.";
|
description = "The path of the storage.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@ let
|
||||||
genCalendarStr = name: value:
|
genCalendarStr = name: value:
|
||||||
concatStringsSep "\n" ([
|
concatStringsSep "\n" ([
|
||||||
"[[${name}]]"
|
"[[${name}]]"
|
||||||
"highlight_event_days = True"
|
|
||||||
"path = ${
|
"path = ${
|
||||||
value.local.path + "/"
|
value.local.path + "/"
|
||||||
+ (optionalString (value.khal.type == "discover") value.khal.glob)
|
+ (optionalString (value.khal.type == "discover") value.khal.glob)
|
||||||
|
@ -158,6 +157,7 @@ in {
|
||||||
# locale = definedAttrs (cfg.locale // { _module = null; });
|
# locale = definedAttrs (cfg.locale // { _module = null; });
|
||||||
|
|
||||||
default = optionalAttrs (!isNull primaryAccount) {
|
default = optionalAttrs (!isNull primaryAccount) {
|
||||||
|
highlight_event_days = true;
|
||||||
default_calendar = if isNull primaryAccount.primaryCollection then
|
default_calendar = if isNull primaryAccount.primaryCollection then
|
||||||
primaryAccount.name
|
primaryAccount.name
|
||||||
else
|
else
|
||||||
|
|
|
@ -88,6 +88,7 @@ import nmt {
|
||||||
./modules/programs/k9s
|
./modules/programs/k9s
|
||||||
./modules/programs/kakoune
|
./modules/programs/kakoune
|
||||||
./modules/programs/kitty
|
./modules/programs/kitty
|
||||||
|
./modules/programs/khal
|
||||||
./modules/programs/ledger
|
./modules/programs/ledger
|
||||||
./modules/programs/less
|
./modules/programs/less
|
||||||
./modules/programs/lf
|
./modules/programs/lf
|
||||||
|
|
32
tests/modules/programs/khal/config.nix
Normal file
32
tests/modules/programs/khal/config.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.khal.enable = true;
|
||||||
|
accounts.calendar = {
|
||||||
|
basePath = "$XDG_CONFIG_HOME/cal";
|
||||||
|
accounts = {
|
||||||
|
test = {
|
||||||
|
primary = true;
|
||||||
|
primaryCollection = "test";
|
||||||
|
khal = {
|
||||||
|
enable = true;
|
||||||
|
readOnly = true;
|
||||||
|
type = "calendar";
|
||||||
|
};
|
||||||
|
local.type = "filesystem";
|
||||||
|
local.fileExt = ".ics";
|
||||||
|
name = "test";
|
||||||
|
remote = {
|
||||||
|
type = "http";
|
||||||
|
url = "https://example.com/events.ical";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs = { khal = { }; };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/khal/config
|
||||||
|
'';
|
||||||
|
}
|
1
tests/modules/programs/khal/default.nix
Normal file
1
tests/modules/programs/khal/default.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ khal-config = ./config.nix; }
|
Loading…
Reference in a new issue