programs.khal: Simplify calendar setup (#5073)
* programs.khal: fix build failure due to null value * calendar: allow null value for primaryCollection * calendar / programs.khal: set default values to avoid common errors
This commit is contained in:
parent
613384a511
commit
40c57ce052
|
@ -18,12 +18,13 @@ let
|
||||||
|
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = types.enum [ "filesystem" "singlefile" ];
|
type = types.enum [ "filesystem" "singlefile" ];
|
||||||
|
default = "filesystem";
|
||||||
description = "The type of the storage.";
|
description = "The type of the storage.";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileExt = mkOption {
|
fileExt = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = ".ics";
|
||||||
description = "The file extension to use.";
|
description = "The file extension to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,7 +99,8 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
primaryCollection = mkOption {
|
primaryCollection = mkOption {
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
description = ''
|
description = ''
|
||||||
The primary collection of the account. Required when an
|
The primary collection of the account. Required when an
|
||||||
account has multiple collections.
|
account has multiple collections.
|
||||||
|
@ -106,8 +108,8 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
local = mkOption {
|
local = mkOption {
|
||||||
type = types.nullOr (localModule name);
|
type = localModule name;
|
||||||
default = null;
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Local configuration for the calendar.
|
Local configuration for the calendar.
|
||||||
'';
|
'';
|
||||||
|
@ -129,6 +131,7 @@ in {
|
||||||
options.accounts.calendar = {
|
options.accounts.calendar = {
|
||||||
basePath = mkOption {
|
basePath = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
example = ".calendar";
|
||||||
apply = p:
|
apply = p:
|
||||||
if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
|
if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
|
||||||
description = ''
|
description = ''
|
||||||
|
|
|
@ -5,8 +5,8 @@ with lib;
|
||||||
{
|
{
|
||||||
options.khal = {
|
options.khal = {
|
||||||
type = mkOption {
|
type = mkOption {
|
||||||
type = types.nullOr (types.enum [ "calendar" "discover" ]);
|
type = types.enum [ "calendar" "discover" ];
|
||||||
default = null;
|
default = "calendar";
|
||||||
description = ''
|
description = ''
|
||||||
Either a single calendar (calendar which is the default) or a directory with multiple calendars (discover).
|
Either a single calendar (calendar which is the default) or a directory with multiple calendars (discover).
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue