Extend the vendor configuration

This commit is contained in:
Manuel Thalmann 2024-05-16 00:40:04 +02:00
parent 562bcc0574
commit ebb42250a7

View file

@ -78,7 +78,7 @@ let
}); });
mkWebdavProvider = ( mkWebdavProvider = (
{ displayName, vendor, ... }: ( { displayName, vendor ? null, ... }: (
{ config, ... }: { { config, ... }: {
imports = [ imports = [
mkProvider mkProvider
@ -86,7 +86,15 @@ let
options = { options = {
vendor = lib.mkOption { vendor = lib.mkOption {
type = lib.types.str; type = lib.types.nullOr (lib.types.enum [
"fastmail"
nextcloudVendor
owncloudVendor
"sharepoint"
"sharepoint-ntlm"
"rclone"
"other"
]);
description = "The vendor of the WebDAV share."; description = "The vendor of the WebDAV share.";
default = vendor; default = vendor;
}; };
@ -118,10 +126,8 @@ let
config = { config = {
config = lib.mkMerge [ config = lib.mkMerge [
{ { url = config.url; }
inherit vendor; (mkIfNotNull config.vendor { inherit (config) vendor; })
url = config.url;
}
(mkIfNotNull config.username { user = config.username; }) (mkIfNotNull config.username { user = config.username; })
(mkIfNotNull config.obscuredPassword { pass = config.obscuredPassword; }) (mkIfNotNull config.obscuredPassword { pass = config.obscuredPassword; })
]; ];