From 58dd7a02d11cf3aec06c405fcc8d820f4ca20a8c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 13 Sep 2020 16:59:19 +0000 Subject: [PATCH] ldap working for now --- configuration.nix | 26 ++------------------------ openldap.nix | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 openldap.nix diff --git a/configuration.nix b/configuration.nix index a5da3dd..d4b1de2 100644 --- a/configuration.nix +++ b/configuration.nix @@ -11,6 +11,7 @@ ./nextcloud.nix ./matrix-synapse.nix ./nginx.nix + ./openldap.nix ]; # Boot @@ -37,13 +38,6 @@ security.acme.email = "webmaster@bib3.de"; security.acme.acceptTerms = true; - # Select internationalisation properties. - # i18n.defaultLocale = "en_US.UTF-8"; - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # }; - # Set your time zone. time.timeZone = "UTC"; @@ -62,22 +56,6 @@ services.openssh.enable = true; networking.firewall.allowedTCPPorts = [ 22 80 443 ]; - services.nginx = { - enable = true; - # only recommendedProxySettings and recommendedGzipSettings are strictly required, - # but the rest make sense as well - recommendedTlsSettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - recommendedProxySettings = true; - - virtualHosts = { - "default_server" = { - root = "/var/www/default"; - }; - }; - }; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.loooph = { isNormalUser = true; @@ -100,7 +78,7 @@ # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ - wget vim git htop tmux openssl + wget vim git htop tmux openssl fd ]; } diff --git a/openldap.nix b/openldap.nix new file mode 100644 index 0000000..7b7e4ff --- /dev/null +++ b/openldap.nix @@ -0,0 +1,24 @@ +{config, pkgs, ...}: + +{ + services.openldap = { + enable = true; + dataDir = "/var/lib/openldap"; + rootpwFile = "/etc/nixos/secret/openldaproot.pw"; + suffix = "o=bib3,c=DE"; + rootdn = "cn=admin,o=bib3,c=DE"; + declarativeContents = '' + dn: o=bib3, c=DE + objectclass: organization + + dn: ou=users, o=bib3, c=DE + objectclass: organizationalUnit + ou: users + + dn: cn=test, ou=users, o=bib3, c=DE + objectclass: person + cn: test + sn: test + ''; + }; +}