diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix index 19d1738182f4..8ea4106709ab 100644 --- a/pkgs/lib/strings.nix +++ b/pkgs/lib/strings.nix @@ -171,4 +171,9 @@ rec { assert ! eqStrings name filename; name; + + # Create an --{enable,disable}- string that can be passed to + # standard GNU Autoconf scripts. + enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}"; + }