diff --git a/lib/strings.nix b/lib/strings.nix index f62ff6679ef..fbb48dec92a 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -561,7 +561,9 @@ rec { enableFeature false "shared" => "--disable-shared" */ - enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}"; + enableFeature = enable: feat: + assert isString feat; # e.g. passing openssl instead of "openssl" + "--${if enable then "enable" else "disable"}-${feat}"; /* Create an --{enable-=,disable-} string that can be passed to standard GNU Autoconf scripts. @@ -583,7 +585,9 @@ rec { withFeature false "shared" => "--without-shared" */ - withFeature = with_: feat: "--${if with_ then "with" else "without"}-${feat}"; + withFeature = with_: feat: + assert isString feat; # e.g. passing openssl instead of "openssl" + "--${if with_ then "with" else "without"}-${feat}"; /* Create an --{with-=,without-} string that can be passed to standard GNU Autoconf scripts.