From 008c7ebfb90defb45d39e1df5b3e836a6c1bc944 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Sun, 1 Sep 2024 20:07:20 +0200 Subject: [PATCH] gerd.lldap: added lldap-cli --- machines/gerd/services/lldap.nix | 6 +++++ shared/pkgs/lldap-cli.nix | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 shared/pkgs/lldap-cli.nix diff --git a/machines/gerd/services/lldap.nix b/machines/gerd/services/lldap.nix index 3961687..6c9958f 100644 --- a/machines/gerd/services/lldap.nix +++ b/machines/gerd/services/lldap.nix @@ -18,7 +18,13 @@ index 71e4928..63be13c 100644 let server_builder = infra::ldap_server::build_ldap_server( &config, ''; + + pkgLLDAPCli = pkgs.callPackage ./../../../shared/pkgs/lldap-cli.nix {}; in { + environment.systemPackages = [ + pkgLLDAPCli + ]; + services.lldap = { enable = true; diff --git a/shared/pkgs/lldap-cli.nix b/shared/pkgs/lldap-cli.nix new file mode 100644 index 0000000..bfc11a1 --- /dev/null +++ b/shared/pkgs/lldap-cli.nix @@ -0,0 +1,42 @@ +{ + stdenv +, lib +, fetchFromGitHub +, makeWrapper +, bash +, gnugrep +, gnused +, jq +, curl +}: + +stdenv.mkDerivation rec { + pname = "lldap-cli"; + version = "unstable-2024-08-31"; + + src = fetchFromGitHub { + owner = "Zepmann"; + repo = "lldap-cli"; + rev = "6eb61cef179696633cafe080a018cd085d3c3f64"; + sha256 = "sha256-Jchj4vqlGWmjFtdMwZAnI4VyBh+/p6rgZrpA77xlSb4="; + }; + + buildInputs = [ + bash + gnugrep + gnused + jq + curl + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = '' + mkdir -p $out/bin + cp lldap-cli $out/bin/lldap-cli + wrapProgram $out/bin/lldap-cli \ + --prefix PATH : ${lib.makeBinPath buildInputs} + ''; +}