Store names of vendors only once

This commit is contained in:
Manuel Thalmann 2024-05-16 00:38:44 +02:00
parent f61258a6ae
commit 562bcc0574

View file

@ -2,6 +2,9 @@
let
cfg = config.programs.rclone;
targetName = "rclone";
owncloudVendor = "owncloud";
owncloudName = "Owncloud";
nextcloudVendor = "nextcloud";
mkIfNotNull = value: result: lib.mkIf (value != null) result;
mkSystemdDependencyOption =
@ -129,9 +132,7 @@ let
};
}));
owncloudName = "Owncloud";
mkOwncloudProvider = { displayName ? owncloudName, vendor ? "owncloud" }: (
mkOwncloudProvider = { displayName ? owncloudName, vendor ? owncloudVendor }: (
{ config, ... }: {
imports = [
(mkWebdavProvider { inherit displayName vendor; })
@ -150,16 +151,16 @@ let
});
syncProviders = {
nextcloud = rec {
${nextcloudVendor} = rec {
displayName = "Nextcloud";
module = mkOwncloudProvider {
inherit displayName;
vendor = "nextcloud";
vendor = nextcloudVendor;
};
};
owncloud = {
${owncloudVendor} = {
displayName = owncloudName;
module = mkOwncloudProvider { };
};