simplify nixos module
1 file changed, 5 insertions(+), 37 deletions(-)
changed files
M flake.nix → flake.nix
@@ -187,41 +187,18 @@ calendars = mkOption { default = [ ]; description = '' - Configuration for multiple calendars. This option will be appended to the - singular calendar option if both are specified. + Configuration for multiple calendars. + + See https://git.alin.ovh/mycal/blob/main/config.toml.example ''; + 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. - ''; - }; - }; + freeformType = settingsFormat.type; }); }; email = mkOption { type = types.str; - default = ""; example = "john.doe@example.com"; description = '' Email address of the user.@@ -233,15 +210,6 @@ }; }; config = mkIf cfg.enable { - # Validate configuration - assertions = [ - { - assertion = with cfg.settings; - (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"; - } - ]; - systemd.services.mycal = { description = "Mycal Calendar Service";