grimm-nixos-laptop/modules/auth.nix

37 lines
814 B
Nix
Raw Normal View History

2024-05-11 11:37:59 +02:00
{ config, ... }:
let
2024-05-11 22:55:59 +02:00
inherit (config.serverConfig) vhosts;
2024-05-10 16:59:38 +02:00
inherit (config.networking) domain;
2024-05-11 11:37:59 +02:00
in
{
2024-05-10 16:59:38 +02:00
services.authentik = {
enable = true;
# The environmentFile needs to be on the target host!
# Best use something like sops-nix or agenix to manage it
environmentFile = "/run/secrets/authentik/authentik-env";
# authentik_env.age
age.secrets.authentik_env = {
file = ../secrets/authentik_env.age;
owner = "authentik";
group = "authentik";
mode = "0600";
};
settings = {
email = rec {
host = vhosts.mail_host.host;
port = 465;
username = "admin@${domain}";
use_tls = true;
use_ssl = true;
from = username;
};
disable_startup_analytics = true;
avatars = "initials";
2024-05-11 11:37:59 +02:00
};
2024-05-10 16:59:38 +02:00
};
}