1 { config, lib, pkgs, ... }:
3 inherit (lib) mkIf mkOption mkPackageOption mkRemovedOptionModule;
4 inherit (lib.types) bool;
6 mkRemovedOptionModule' = name: reason: mkRemovedOptionModule ["krb5" name] reason;
7 mkRemovedOptionModuleCfg = name: mkRemovedOptionModule' name ''
8 The option `krb5.${name}' has been removed. Use
9 `security.krb5.settings.${name}' for structured configuration.
12 cfg = config.security.krb5;
13 format = import ./krb5-conf-format.nix { inherit pkgs lib; } { };
16 (mkRemovedOptionModuleCfg "libdefaults")
17 (mkRemovedOptionModuleCfg "realms")
18 (mkRemovedOptionModuleCfg "domain_realm")
19 (mkRemovedOptionModuleCfg "capaths")
20 (mkRemovedOptionModuleCfg "appdefaults")
21 (mkRemovedOptionModuleCfg "plugins")
22 (mkRemovedOptionModuleCfg "config")
23 (mkRemovedOptionModuleCfg "extraConfig")
24 (mkRemovedOptionModule' "kerberos" ''
25 The option `krb5.kerberos' has been moved to `security.krb5.package'.
33 description = "Enable and configure Kerberos utilities";
37 package = mkPackageOption pkgs "krb5" {
45 Structured contents of the {file}`krb5.conf` file. See
46 {manpage}`krb5.conf(5)` for details about configuration.
49 include = [ "/run/secrets/secret-krb5.conf" ];
50 includedir = [ "/run/secrets/secret-krb5.conf.d" ];
53 default_realm = "ATHENA.MIT.EDU";
58 admin_server = "athena.mit.edu";
67 "mit.edu" = "ATHENA.MIT.EDU";
71 kdc = "SYSLOG:NOTICE";
72 admin_server = "SYSLOG:NOTICE";
73 default = "SYSLOG:NOTICE";
81 assertions = mkIf (cfg.enable || config.services.kerberos_server.enable) [(let
82 implementation = cfg.package.passthru.implementation or "<NOT SET>";
84 assertion = lib.elem implementation [ "krb5" "heimdal" ];
86 `security.krb5.package` must be one of:
91 Currently chosen implementation: ${implementation}
95 environment = mkIf cfg.enable {
96 systemPackages = [ cfg.package ];
97 etc."krb5.conf".source = format.generate "krb5.conf" cfg.settings;
101 meta.maintainers = builtins.attrValues {
102 inherit (lib.maintainers) dblsaiko h7x4;