nix-config/hosts/auth/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
1.6 KiB
Nix
Raw Normal View History

{ config, lib, libz, ... }:
2022-07-23 00:06:12 +02:00
{
c3d2.deployment.server = "server10";
2022-07-23 00:06:12 +02:00
system.stateVersion = "22.05";
networking = {
hostName = "auth";
2022-07-23 02:04:42 +02:00
firewall.allowedTCPPorts = [
636 # ldaps
];
2022-07-23 00:06:12 +02:00
};
services = {
2022-12-23 08:22:28 +01:00
dex.settings.oauth2.skipApprovalScreen = true;
2022-07-23 00:06:12 +02:00
nginx = {
enable = true;
virtualHosts."auth.c3d2.de" = {
default = true;
forceSSL = true;
enableACME = true;
locations = {
"/".proxyPass = "http://localhost:${toString config.services.portunus.port}";
2022-07-23 00:06:12 +02:00
"/dex".proxyPass ="http://localhost:${toString config.services.portunus.dex.port}";
};
};
};
portunus = {
enable = true;
dex = {
2022-12-23 08:22:28 +01:00
enable = true;
oidcClients = [ {
callbackURL = "https://grafana.hq.c3d2.de/login/generic_oauth";
id = "grafana";
} ];
2022-07-23 00:06:12 +02:00
};
domain = "auth.c3d2.de";
ldap = {
searchUserName = "search";
2022-07-23 00:06:12 +02:00
suffix = "dc=c3d2,dc=de";
tls = true;
};
2022-08-01 00:16:40 +02:00
seedPath = config.sops.secrets."portunus/seed".path;
};
};
sops = {
defaultSopsFile = ./secrets.yaml;
2022-12-23 08:22:28 +01:00
secrets."dex/environment" = libz.sops.permissionForUser "dex";
secrets."portunus/seed" = libz.sops.permissionForUser "portunus";
2022-07-23 00:06:12 +02:00
};
2022-12-23 08:22:28 +01:00
systemd.services.dex.serviceConfig = {
DynamicUser = lib.mkForce false;
EnvironmentFile = config.sops.secrets."dex/environment".path;
StateDirectory = "dex";
User = "dex";
};
users = {
groups.dex = { };
users.dex = {
group = "dex";
isSystemUser = true;
};
};
2022-07-23 00:06:12 +02:00
}