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
|
let
|
||||||
cfg = config.programs.rclone;
|
cfg = config.programs.rclone;
|
||||||
targetName = "rclone";
|
targetName = "rclone";
|
||||||
|
owncloudVendor = "owncloud";
|
||||||
|
owncloudName = "Owncloud";
|
||||||
|
nextcloudVendor = "nextcloud";
|
||||||
mkIfNotNull = value: result: lib.mkIf (value != null) result;
|
mkIfNotNull = value: result: lib.mkIf (value != null) result;
|
||||||
|
|
||||||
mkSystemdDependencyOption =
|
mkSystemdDependencyOption =
|
||||||
|
@ -129,9 +132,7 @@ let
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
owncloudName = "Owncloud";
|
mkOwncloudProvider = { displayName ? owncloudName, vendor ? owncloudVendor }: (
|
||||||
|
|
||||||
mkOwncloudProvider = { displayName ? owncloudName, vendor ? "owncloud" }: (
|
|
||||||
{ config, ... }: {
|
{ config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
(mkWebdavProvider { inherit displayName vendor; })
|
(mkWebdavProvider { inherit displayName vendor; })
|
||||||
|
@ -150,16 +151,16 @@ let
|
||||||
});
|
});
|
||||||
|
|
||||||
syncProviders = {
|
syncProviders = {
|
||||||
nextcloud = rec {
|
${nextcloudVendor} = rec {
|
||||||
displayName = "Nextcloud";
|
displayName = "Nextcloud";
|
||||||
|
|
||||||
module = mkOwncloudProvider {
|
module = mkOwncloudProvider {
|
||||||
inherit displayName;
|
inherit displayName;
|
||||||
vendor = "nextcloud";
|
vendor = nextcloudVendor;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
owncloud = {
|
${owncloudVendor} = {
|
||||||
displayName = owncloudName;
|
displayName = owncloudName;
|
||||||
module = mkOwncloudProvider { };
|
module = mkOwncloudProvider { };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue