mirror of
https://github.com/nix-community/home-manager
synced 2024-12-25 03:09:47 +01:00
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
9da77acf45
commit
05f0e9a0b5
2 changed files with 9 additions and 6 deletions
|
@ -18,12 +18,13 @@ let
|
|||
|
||||
type = mkOption {
|
||||
type = types.enum [ "filesystem" "singlefile" ];
|
||||
default = "filesystem";
|
||||
description = "The type of the storage.";
|
||||
};
|
||||
|
||||
fileExt = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
default = ".ics";
|
||||
description = "The file extension to use.";
|
||||
};
|
||||
|
||||
|
@ -98,7 +99,8 @@ let
|
|||
};
|
||||
|
||||
primaryCollection = mkOption {
|
||||
type = types.str;
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The primary collection of the account. Required when an
|
||||
account has multiple collections.
|
||||
|
@ -106,8 +108,8 @@ let
|
|||
};
|
||||
|
||||
local = mkOption {
|
||||
type = types.nullOr (localModule name);
|
||||
default = null;
|
||||
type = localModule name;
|
||||
default = { };
|
||||
description = ''
|
||||
Local configuration for the calendar.
|
||||
'';
|
||||
|
@ -129,6 +131,7 @@ in {
|
|||
options.accounts.calendar = {
|
||||
basePath = mkOption {
|
||||
type = types.str;
|
||||
example = ".calendar";
|
||||
apply = p:
|
||||
if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}";
|
||||
description = ''
|
||||
|
|
|
@ -5,8 +5,8 @@ with lib;
|
|||
{
|
||||
options.khal = {
|
||||
type = mkOption {
|
||||
type = types.nullOr (types.enum [ "calendar" "discover" ]);
|
||||
default = null;
|
||||
type = types.enum [ "calendar" "discover" ];
|
||||
default = "calendar";
|
||||
description = ''
|
||||
Either a single calendar (calendar which is the default) or a directory with multiple calendars (discover).
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue