module: refactor as preparation for ldap-outpost
This commit is contained in:
parent
48fb996263
commit
360f4c7321
1 changed files with 112 additions and 111 deletions
25
module.nix
25
module.nix
|
|
@ -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
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}))
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue