Store names of vendors only once
This commit is contained in:
parent
f61258a6ae
commit
562bcc0574
1 changed files with 7 additions and 6 deletions
|
@ -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 { };
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue