diff --git a/pkgs/build-support/fetchpatch/default.nix b/pkgs/build-support/fetchpatch/default.nix index aae62b688739..b350a0a809fa 100644 --- a/pkgs/build-support/fetchpatch/default.nix +++ b/pkgs/build-support/fetchpatch/default.nix @@ -38,10 +38,10 @@ in let inherit (args') stripLen extraPrefix; in -lib.throwIfNot (excludes == [ ] || includes == [ ]) - "fetchpatch: cannot use excludes and includes simultaneously" - fetchurl - ( +if excludes != [ ] && includes != [ ] then + throw "fetchpatch: cannot use excludes and includes simultaneously" +else + fetchurl ( { nativeBuildInputs = [ patchutils ] ++ nativeBuildInputs; postFetch = ''