7 , enablePAM ? stdenv.hostPlatform.isLinux
13 # python binding generates a shared library which are unavailable with musl build
14 assert enablePython -> !stdenv.hostPlatform.isStatic;
16 stdenv.mkDerivation rec {
17 pname = "libpwquality";
20 outputs = [ "out" "dev" "lib" "man" ] ++ lib.optionals enablePython [ "py" ];
22 src = fetchFromGitHub {
23 owner = "libpwquality";
24 repo = "libpwquality";
25 rev = "${pname}-${version}";
26 sha256 = "sha256-YjvHzd4iEBvg+qHOVJ7/y9HqyeT+QDalNE/jdNM9BNs=";
30 # ensure python site-packages goes in $py output
31 ./python-binding-prefix.patch
34 nativeBuildInputs = [ autoreconfHook perl ] ++ lib.optionals enablePython [ python ];
35 buildInputs = [ cracklib ] ++ lib.optionals enablePAM [ pam ];
37 configureFlags = lib.optionals (!enablePython) [ "--disable-python-bindings" ];
40 homepage = "https://github.com/libpwquality/libpwquality";
41 description = "Password quality checking and random password generation library";
43 The libpwquality library purpose is to provide common functions for
44 password quality checking and also scoring them based on their apparent
45 randomness. The library also provides a function for generating random
46 passwords with good pronounceability. The library supports reading and
47 parsing of a configuration file.
49 In the package there are also very simple utilities that use the library
50 function and PAM module that can be used instead of pam_cracklib. The
51 module supports all the options of pam_cracklib.
53 license = with licenses; [ bsd3 /* or */ gpl2Plus ];
54 maintainers = with maintainers; [ jk ];
55 platforms = platforms.unix;