mkModule migration begin

This commit is contained in:
mjallen18
2025-12-14 22:54:01 -06:00
parent 3dc1055b54
commit 2d03954a9f
2 changed files with 21 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ with lib;
let
name = "authentik";
cfg = config.${namespace}.services.${name};
cfgRac = config.${namespace}.services."authentikRac";
authentikConfig = lib.${namespace}.mkModule {
inherit config name;
@@ -26,17 +27,6 @@ let
enable = mkDefault true;
port = mkDefault 6379;
};
# postgresql = {
# enable = mkDefault true;
# ensureDatabases = [ name ];
# ensureUsers = [
# {
# name = name;
# ensureDBOwnership = true;
# }
# ];
# };
};
# Open firewall for authentik if enabled
@@ -48,11 +38,19 @@ let
4822
];
};
};
};
virtualisation.oci-containers.containers.authentik_rac = {
authentikRacConfig = lib.${namespace}.mkModule {
inherit config;
name = "authentikRac";
description = "authentik_rac Service";
options = { };
moduleConfig = {
virtualisation.oci-containers.containers."authenticRac" = {
autoStart = true;
image = "ghcr.io/goauthentik/rac";
ports = [ "4822:4822" ];
ports = [ "${toString cfgRac.port}:4822" ];
volumes = [
"${cfg.configDir}/authentik-rac:/media"
];
@@ -69,5 +67,8 @@ let
};
in
{
imports = [ authentikConfig ];
imports = [
authentikConfig
authentikRacConfig
];
}

View File

@@ -28,10 +28,15 @@ in
};
authentik = {
enable = true;
# configureDb = true;
configureDb = true;
port = 9000;
environmentFile = "/run/secrets/jallen-nas/authentik-env";
};
authentikRac = {
enable = true;
port = 4822;
# environmentFile = "/run/secrets/jallen-nas/authentik-env"; # TODO
};
calibre = {
enable = true;
port = 8084;