From 562bcc057441c03b1feb6617182197eee40c3bd6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 16 May 2024 00:38:44 +0200 Subject: [PATCH] Store names of vendors only once --- lib/modules/rclone.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/modules/rclone.nix b/lib/modules/rclone.nix index a1bfaae..eecef17 100644 --- a/lib/modules/rclone.nix +++ b/lib/modules/rclone.nix @@ -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 { }; };