Add extended options for Owncloud remotes
This commit is contained in:
parent
09e60ca053
commit
faf4a0a290
1 changed files with 20 additions and 2 deletions
|
@ -129,11 +129,29 @@ let
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
mkOwncloudProvider = { displayName ? "Owncloud", vendor ? "owncloud" }: (
|
||||||
|
{ config, ... }: {
|
||||||
|
imports = [
|
||||||
|
(mkWebdavProvider { inherit displayName vendor; })
|
||||||
|
];
|
||||||
|
|
||||||
|
options = {
|
||||||
|
baseUrl = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "The base url of the ${displayName} server for automatically determining the WebDAV url.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
url = "${lib.strings.removeSuffix "/" (lib.strings.normalizePath config.baseUrl)}/remote.php/dav/files/${config.username}";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
syncProviders = {
|
syncProviders = {
|
||||||
nextcloud = rec {
|
nextcloud = rec {
|
||||||
displayName = "Nextcloud";
|
displayName = "Nextcloud";
|
||||||
|
|
||||||
module = mkWebdavProvider {
|
module = mkOwncloudProvider {
|
||||||
inherit displayName;
|
inherit displayName;
|
||||||
vendor = "nextcloud";
|
vendor = "nextcloud";
|
||||||
};
|
};
|
||||||
|
@ -225,7 +243,7 @@ in {
|
||||||
|
|
||||||
Install = {
|
Install = {
|
||||||
WantedBy = lib.optional sync.autoStart "${targetName}.target";
|
WantedBy = lib.optional sync.autoStart "${targetName}.target";
|
||||||
After = builtins.concatLists(builtins.attrValues sync.systemdDependencies);
|
After = builtins.concatLists (builtins.attrValues sync.systemdDependencies);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue