diff --git a/lib/modules/rclone.nix b/lib/modules/rclone.nix index 955effb..30fa9f9 100644 --- a/lib/modules/rclone.nix +++ b/lib/modules/rclone.nix @@ -17,26 +17,23 @@ let mkProvider = { - secretLoader ? ({ ... }: ""), - envLoader ? ({ ... }: { }), - configLoader ? ({ ... }: { }), - options ? {}, - ... - }: { + secretsScript ? "", + environment ? { }, + config ? { }, + options ? { }, + defaultOptions ? { } + }: + { ... }: { inherit - secretLoader - envLoader - configLoader + secretsScript + environment + config options ; }; syncProviders = { - nextcloud = mkProvider { - options = lib.types.submodule ( - (mkOwncloudOptions { })); - }; - + nextcloud = mkProvider {}; proton = mkProvider {}; manual = mkProvider {}; }; @@ -88,11 +85,16 @@ let }; }; - config = { - environment = syncProviders.${config.type}.envLoader config; - secretsScript = syncProviders.${config.type}.secretLoader config; - config = syncProviders.${config.type}.configLoader config; - }; + config = + let + syncProvider = syncProviders.${config.type} config; + in { + inherit (syncProvider) + environment + secretsScript + config + ; + }; }); in { options = {