diff --git a/modules/programs/khal/default.nix b/modules/programs/khal/default.nix index 83d2d70e2..65f8f02a5 100644 --- a/modules/programs/khal/default.nix +++ b/modules/programs/khal/default.nix @@ -58,7 +58,7 @@ let "[[${name}]]" "path = ${ value.local.path - + "/" + + "/" # TODO: dont add slash if type is "singlefile" + (optionalString (value.khal.type == "discover") value.khal.glob) + (optionalString ( value.khal.type == "birthdays" && value.khal ? thisCollection diff --git a/tests/modules/programs/khal/config.nix b/tests/modules/programs/khal/config.nix index 3f3b9225b..4e189a3b9 100644 --- a/tests/modules/programs/khal/config.nix +++ b/tests/modules/programs/khal/config.nix @@ -58,6 +58,17 @@ url = "https://example.com/events.ical"; }; }; + testSinglefile = { + khal = { + enable = true; + readOnly = true; + addresses = [ "study@university.edu" ]; + }; + local = { + type = "singlefile"; + path = "$XDG_CONFIG_HOME/cal/timetable.ics"; + }; + }; }; }; diff --git a/tests/modules/programs/khal/khal-config-expected b/tests/modules/programs/khal/khal-config-expected index 32fe7270f..274c2795a 100644 --- a/tests/modules/programs/khal/khal-config-expected +++ b/tests/modules/programs/khal/khal-config-expected @@ -23,6 +23,13 @@ priority=10 type=calendar +[[testSinglefile]] +path = $XDG_CONFIG_HOME/cal/timetable.ics +readonly = True +addresses= study@university.edu +priority=10 +type=calendar + [[testcontacts-automaticallyCollected]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected