Extend the vendor configuration
This commit is contained in:
parent
562bcc0574
commit
ebb42250a7
1 changed files with 12 additions and 6 deletions
|
@ -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; })
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue