remove backwards compatibility
1 file changed, 29 insertions(+), 49 deletions(-)
changed files
M flake.nix → flake.nix
@@ -123,34 +123,6 @@ cfg = config.services.mycal; settingsFormat = pkgs.formats.toml { }; inherit (lib) mkEnableOption mkOption mkIf types; - - calendarOptionType = types.submodule { - options = { - file = mkOption { - type = with types; nullOr str; - default = ""; - example = "/path/to/calendar/file"; - description = '' - Path to the calendar file. Preferred over URL. - ''; - }; - url = mkOption { - type = with types; nullOr str; - default = ""; - example = "https://example.com/calendar.ics"; - description = '' - URL to the calendar file. - ''; - }; - all_tentative = mkOption { - type = types.bool; - default = false; - description = '' - Whether all events from this calendar should be marked as tentative. - ''; - }; - }; - }; in { options.services.mycal = {@@ -204,25 +176,39 @@ Default timezone for the calendar. ''; }; - calendar = mkOption { - default = { }; - description = '' - Configuration for a single calendar. Either a file or a URL must be provided. - This option is kept for backward compatibility. Using the calendars option - is recommended for new configurations. - - Note: This option is deprecated and will be removed in a future release. - ''; - type = calendarOptionType; - }; - calendars = mkOption { default = [ ]; description = '' Configuration for multiple calendars. This option will be appended to the singular calendar option if both are specified. ''; - type = types.listOf calendarOptionType; + type = types.listOf (types.submodule { + options = { + file = mkOption { + type = with types; nullOr str; + default = null; + example = "/path/to/calendar/file"; + description = '' + Path to the calendar file. Preferred over URL. + ''; + }; + url = mkOption { + type = with types; nullOr str; + default = null; + example = "https://example.com/calendar.ics"; + description = '' + URL to the calendar file. + ''; + }; + all_tentative = mkOption { + type = types.bool; + default = false; + description = '' + Whether all events from this calendar should be marked as tentative. + ''; + }; + }; + }); }; email = mkOption {@@ -243,16 +229,10 @@ # Validate configuration assertions = [ { assertion = with cfg.settings; - (calendars != [ ] && builtins.any (cal: cal.file != "" || cal.url != "") calendars) || - (calendar.file != "" || calendar.url != ""); - message = "At least one calendar must be configured with either a file or URL in either settings.calendar or settings.calendars"; + (calendars != [ ] && builtins.any (cal: cal.file != "" || cal.url != "") calendars); + message = "At least one calendar must be configured with either a file or URL in settings.calendars"; } ]; - - # Issue deprecation warning if the calendar option is used - warnings = lib.optional - (cfg.settings.calendar.file != "" || cfg.settings.calendar.url != "") - "The settings.calendar option is deprecated and will be removed in a future release. Please use the settings.calendars option instead."; systemd.services.mycal = { description = "Mycal Calendar Service";