module: refactor as preparation for ldap-outpost

This commit is contained in:
WilliButz 2023-06-28 17:11:06 +02:00
parent 48fb996263
commit 360f4c7321
No known key found for this signature in database
GPG key ID: FB0513677AB15BEA

View file

@ -4,29 +4,23 @@
, ...
}:
let
cfg = config.services.authentik;
inherit (lib)
types;
inherit (lib.modules)
mkDefault
mkIf;
mkIf
mkMerge;
inherit (lib.options)
mkEnableOption
mkOption;
inherit (cfg.authentikComponents)
migrate
gopkgs
celery
staticWorkdirDeps;
settingsFormat = pkgs.formats.yaml {};
in
{
options.services.authentik = {
options.services = {
authentik = {
enable = mkEnableOption "authentik";
authentikComponents = {
@ -51,8 +45,14 @@ in
default = true;
};
};
};
config = mkIf cfg.enable {
config = mkMerge [
# authentik server
(mkIf config.services.authentik.enable (let
cfg = config.services.authentik;
in
{
services = {
authentik.settings = {
blueprints_dir = mkDefault "${cfg.authentikComponents.staticWorkdirDeps}/blueprints";
@ -137,5 +137,6 @@ in
};
};
};
};
}))
];
}