Skip to content

lldap ​

Lightweight LDAP authentication server

Example ​

nix
{config, ...}: {
  nps.stacks.lldap = {
    enable = true;

    baseDn = "DC=example,DC=com";
    jwtSecretFile = config.sops.secrets."lldap/jwtSecret".path;
    keySeedFile = config.sops.secrets."lldap/keySeed".path;
    adminPasswordFile = config.sops.secrets."lldap/adminPassword".path;
    bootstrap = {
      users = {
        guest = {
          email = "guest@example.com";
          password_file = config.sops.secrets."users/guest/password".path;
          displayName = "Guest";
          groups = [
            config.nps.stacks.immich.oidc.userGroup
            config.nps.stacks.streaming.jellyfin.oidc.userGroup
          ];
        };
      };
    };
  };
}

Stack Options ​

nps.stacks.lldap.adminPasswordFile ​

Path to the file containing the admin password.

Type
plaintext
absolute path
Declaration

nps.stacks.lldap.adminUsername ​

Admin username for LDAP as well as the web interface.

Type
plaintext
string
Default
nix
"admin"
Declaration

nps.stacks.lldap.baseDn ​

The starting point in the LDAP directory tree from which searches begin.

Type
plaintext
string
Default
nix
"DC=example,DC=com"
Example
nix
"DC=mydomain,DC=net"
Declaration

nps.stacks.lldap.bootstrap.cleanUp ​

Whether to delete groups and users not specified in the config, also remove users from groups that they do not belong to

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.groupSchemas ​

Group schemas. Can be used to create custom group attributes.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

nps.stacks.lldap.bootstrap.groupSchemas.<name>.attributeType ​

Type of the attribute

Type
plaintext
one of "STRING", "INTEGER", "JPGEG", "DATE_TIME"
Declaration

nps.stacks.lldap.bootstrap.groupSchemas.<name>.isEditable ​

Whether the attribute is editable by users

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.groupSchemas.<name>.isList ​

Whether the attribute can have multiple values

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.groupSchemas.<name>.isVisible ​

Whether the attribute is visible by users

Type
plaintext
boolean
Default
nix
true
Declaration

nps.stacks.lldap.bootstrap.groupSchemas.<name>.name ​

Name of field, case insensitve - you should use lowercase

Type
plaintext
string matching the pattern ^[a-zA-Z0-9-]+$
Default
nix
<name>
Declaration

nps.stacks.lldap.bootstrap.groups ​

Groups that will be created. Besides the name, you can also specify custom attributes for the group, if they are defined in the groupSchemas option.

See https://github.com/lldap/lldap/blob/main/example_configs/bootstrap/bootstrap.md#group-config-file-example

Type
plaintext
attribute set of (open submodule of attribute set of (string or signed integer or boolean))
Default
nix
{ }
Declaration

nps.stacks.lldap.bootstrap.groups.<name>.name ​

Name of the group. Defaults to the name of the attribute.

Type
plaintext
string
Default
nix
<name>
Declaration

nps.stacks.lldap.bootstrap.userSchemas ​

User schema. Can be used to create custom user attributes.

Type
plaintext
attribute set of (submodule)
Default
nix
{ }
Declaration

nps.stacks.lldap.bootstrap.userSchemas.<name>.attributeType ​

Type of the attribute

Type
plaintext
one of "STRING", "INTEGER", "JPGEG", "DATE_TIME"
Declaration

nps.stacks.lldap.bootstrap.userSchemas.<name>.isEditable ​

Whether the attribute is editable by users

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.userSchemas.<name>.isList ​

Whether the attribute can have multiple values

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.userSchemas.<name>.isVisible ​

Whether the attribute is visible by users

Type
plaintext
boolean
Default
nix
true
Declaration

nps.stacks.lldap.bootstrap.userSchemas.<name>.name ​

Name of field, case insensitve - you should use lowercase

Type
plaintext
string matching the pattern ^[a-zA-Z0-9-]+$
Default
nix
<name>
Declaration

nps.stacks.lldap.bootstrap.users ​

LLDAP users that will be provisioned at startup. You can also specify custom attributes for the user, if they are defined in the useSchemas option.

See https://github.com/lldap/lldap/blob/main/example_configs/bootstrap/bootstrap.md#user-config-file-example

Type
plaintext
attribute set of (open submodule of attribute set of (string or signed integer or boolean))
Default
nix
{ }
Declaration

nps.stacks.lldap.bootstrap.users.<name>.avatar_url ​

Must be a valid URL to jpeg file. (ignored if gravatar_avatar specified)

Type
plaintext
null or string
Default
nix
null
Declaration

nps.stacks.lldap.bootstrap.users.<name>.displayName ​

Display name of the user

Type
plaintext
null or string
Default
nix
null
Declaration

nps.stacks.lldap.bootstrap.users.<name>.email ​

E-Mail of the user

Type
plaintext
string
Declaration

nps.stacks.lldap.bootstrap.users.<name>.firstName ​

First name of the user

Type
plaintext
null or string
Default
nix
null
Declaration

nps.stacks.lldap.bootstrap.users.<name>.gravatar_avatar ​

the script will try to get an avatar from gravatar by previously specified email

Type
plaintext
boolean
Default
nix
false
Declaration

nps.stacks.lldap.bootstrap.users.<name>.groups ​

An array of groups the user will be a member of (all the groups must be specified in the bootstrap.groups option)

Type
plaintext
list of string
Default
nix
[ ]
Declaration

nps.stacks.lldap.bootstrap.users.<name>.id ​

ID of the user. Defaults to the name of the attribute.

Type
plaintext
string
Default
nix
<name>
Declaration

nps.stacks.lldap.bootstrap.users.<name>.lastName ​

Last name of the user

Type
plaintext
null or string
Default
nix
null
Declaration

nps.stacks.lldap.bootstrap.users.<name>.password_file ​

Path to the file containing the user password

Type
plaintext
null or absolute path
Default
nix
null
Declaration

nps.stacks.lldap.enable ​

Whether to enable lldap.

Type
plaintext
boolean
Default
nix
false
Example
nix
true
Declaration

nps.stacks.lldap.jwtSecretFile ​

Path to the file containing the JWT secret

Type
plaintext
absolute path
Declaration

nps.stacks.lldap.keySeedFile ​

Path to the file containing the key seed

Type
plaintext
absolute path
Declaration

nps.stacks.lldap.settings ​

Additional lldap configuration. If provided, will be mounted as lldap_config.toml;

See https://github.com/lldap/lldap/blob/main/lldap_config.docker_template.toml

Type
plaintext
null or TOML value
Default
nix
null
Declaration

Container Aliases ​

nps.stacks.lldap.containers.lldap ​

Alias of {option}services.podman.containers.lldap.

Type
plaintext
submodule
Declaration