module: add basic proxy outpost service

This commit is contained in:
Geoffrey “Frogeye” Preud'homme 2025-02-23 23:13:32 +01:00
parent 618330bee6
commit 794eb56bac
No known key found for this signature in database
GPG key ID: C72403E7F82E6AD8

View file

@ -128,6 +128,29 @@ in
}; };
}; };
# Proxy oupost
authentik-proxy = {
enable = mkEnableOption "authentik Proxy outpost";
environmentFile = mkOption {
type = types.nullOr pathToSecret;
default = null;
example = "/run/secrets/authentik-proxy/authentik-proxy-env";
description = ''
Environment file as defined in {manpage}`systemd.exec(5)`.
Secrets may be passed to the service without adding them to the world-readable
/nix/store, by specifying the desied secrets as environment variables according
to the authentic documentation.
```
# example content
AUTHENTIK_TOKEN=<token from authentik for this outpost>
```
'';
};
};
# RADIUS oupost # RADIUS oupost
authentik-radius = { authentik-radius = {
enable = mkEnableOption "authentik RADIUS outpost"; enable = mkEnableOption "authentik RADIUS outpost";
@ -356,6 +379,32 @@ in
} }
)) ))
# Proxy outpost
(mkIf config.services.authentik-proxy.enable (
let
cfg = config.services.authentik-proxy;
in
{
systemd.services.authentik-proxy = {
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [
"network-online.target"
"authentik.service"
];
serviceConfig = {
RuntimeDirectory = "authentik-proxy";
UMask = "0027";
WorkingDirectory = "%t/authentik-proxy";
DynamicUser = true;
ExecStart = "${config.services.authentik.authentikComponents.gopkgs}/bin/proxy";
EnvironmentFile = mkIf (cfg.environmentFile != null) [ cfg.environmentFile ];
Restart = "on-failure";
};
};
}
))
# RADIUS outpost # RADIUS outpost
(mkIf config.services.authentik-radius.enable ( (mkIf config.services.authentik-radius.enable (
let let