Store the provider options flat
This commit is contained in:
parent
1a7a63e433
commit
b781eb7e08
1 changed files with 21 additions and 19 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue