Adding a poor openldap server module.
svn path=/nixos/trunk/; revision=26822
This commit is contained in:
parent
6824866d6d
commit
e7c9266a70
@ -53,6 +53,7 @@
|
||||
./services/backup/sitecopy-backup.nix
|
||||
./services/databases/mysql.nix
|
||||
./services/databases/postgresql.nix
|
||||
./services/databases/openldap.nix
|
||||
./services/games/ghost-one.nix
|
||||
./services/hardware/acpid.nix
|
||||
./services/hardware/bluetooth.nix
|
||||
|
58
modules/services/databases/openldap.nix
Normal file
58
modules/services/databases/openldap.nix
Normal file
@ -0,0 +1,58 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.openldap;
|
||||
openldap = pkgs.openldap;
|
||||
|
||||
configFile = pkgs.writeText "slapd.conf" cfg.extraConfig;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.openldap = {
|
||||
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = "
|
||||
Whether to enable the ldap server.
|
||||
";
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
default = "";
|
||||
description = "
|
||||
sldapd.conf configuration
|
||||
";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf config.services.openldap.enable {
|
||||
|
||||
environment.systemPackages = [ openldap ];
|
||||
|
||||
jobs.openldap =
|
||||
{
|
||||
description = "LDAP server";
|
||||
|
||||
startOn = "filesystem";
|
||||
daemonType = "fork";
|
||||
|
||||
exec = "${openldap}/libexec/slapd -f ${configFile}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user