Store the provider options flat

This commit is contained in:
Manuel Thalmann 2024-05-15 11:48:22 +02:00
parent 1a7a63e433
commit b781eb7e08

View file

@ -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 = {