diff --git a/flake.nix b/flake.nix index 0545c43..b4ebe7e 100644 --- a/flake.nix +++ b/flake.nix @@ -35,20 +35,59 @@ in { options.services.calDavToCsv = { enable = lib.mkEnableOption "calDavToCsv"; - - config = lib.mkOption { - type = lib.types.attrs; - calDavToCsv = { - calDAV = { - address = "localhost:5232"; - username = "username"; - password = "password"; - passwordFile = "/path/to/password"; + settings = lib.mkOption { + description = '' + Your config as an attribute set + ''; + default = { }; + #TODO: provide example + example = '' + { + } + ''; + type = lib.types.submodule { + freeformType = lib.format.type; + caldav = { + address = lib.mkOption { + type = lib.types.str; + default = "tcp://:5232/"; + example = + "unix:///var/run/authelia.sock?path=authelia&umask=0117"; + description = "Address of the caldav calendar"; + }; + username = lib.mkOption { + type = lib.types.str; + example = "John-doe"; + description = "Username of the caldav calendar"; + }; + password = lib.mkOption { + type = lib.types.str; + example = "unsafe-password"; + description = + "Password of the caldav calendar, NOT RECOMMENDED, use passwordFile instead !"; + }; + passwordFile = lib.mkOption { + type = lib.types.str; + example = "/var/lib/calDavToCsv/caldavPassword"; + description = + "Password of the caldav calendar, NOT RECOMMENDED, use passwordFile instead !"; + }; }; - server = { port = 8000; }; }; - description = "User-defined configuration for the service"; }; + # config = lib.mkOption { + # type = lib.types.attrs; + # calDavToCsv = { + # calDAV = { + # address = "localhost:5232"; + # username = "username"; + # password = "password"; + # passwordFile = "/path/to/password"; + # }; + # server = { port = 8000; }; + # }; + # description = "User-defined configuration for the service"; + # }; }; # options.NixosModule = { # enable = lib.mkEnableOption "Enable calDAVtoCSV service";