Author: viric
Date: Wed Apr 13 17:35:19 2011
New Revision: 26822
URL: https://svn.nixos.org/websvn/nix/?rev=26822&sc=1
Log:
Adding a poor openldap server module.
Added:
nixos/trunk/modules/services/databases/openldap.nix
Modified:
nixos/trunk/modules/module-list.nix
Modified: nixos/trunk/modules/module-list.nix
==============================================================================
--- nixos/trunk/modules/module-list.nix Wed Apr 13 15:31:22 2011 (r26821)
+++ nixos/trunk/modules/module-list.nix Wed Apr 13 17:35:19 2011 (r26822)
@@ -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
Added: nixos/trunk/modules/services/databases/openldap.nix
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ nixos/trunk/modules/services/databases/openldap.nix Wed Apr 13 17:35:19
2011 (r26822)
@@ -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}";
+ };
+
+ };
+
+}
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits