1 { config, pkgs, lib, ... }:
4 inherit (lib) mkOption types;
5 cfg = config.services.kerberos_server;
6 inherit (config.security.krb5) package;
8 format = import ../../../security/krb5/krb5-conf-format.nix { inherit pkgs lib; } { enableKdcACLEntries = true; };
13 (lib.mkRenamedOptionModule [ "services" "kerberos_server" "realms" ] [ "services" "kerberos_server" "settings" "realms" ])
20 services.kerberos_server = {
21 enable = lib.mkEnableOption "the kerberos authentication server";
26 Settings for the kerberos server of choice.
28 See the following documentation:
29 - Heimdal: {manpage}`kdc.conf(5)`
30 - MIT Kerberos: <https://web.mit.edu/kerberos/krb5-1.21/doc/admin/conf_files/kdc_conf.html>
37 config = lib.mkIf cfg.enable {
38 environment.systemPackages = [ package ];
41 assertion = cfg.settings.realms != { };
42 message = "The server needs at least one realm";
45 assertion = lib.length (lib.attrNames cfg.settings.realms) <= 1;
46 message = "Only one realm per server is currently supported.";
50 systemd.slices.system-kerberos-server = { };
51 systemd.targets.kerberos-server = {
52 wantedBy = [ "multi-user.target" ];
57 doc = ./kerberos-server.md;