summary refs log tree commit diff
path: root/pkgs/lib/strings.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/strings.nix')
-rw-r--r--pkgs/lib/strings.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index 19d1738182f..8ea4106709a 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}-<feat> string that can be passed to
+  # standard GNU Autoconf scripts.
+  enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
+
 }