@@ -100,6 +100,13 @@ in stdenv.mkDerivation {
100100
101101 patches = [ ./xopts.patch ./nvidia-conf.patch];
102102
103+ # the have() function is deprecated and not available to bash completions the
104+ # way they are currently loaded in NixOS, so use _have. See #10936
105+ patchPhase = ''
106+ substituteInPlace scripts/bash_completion/bumblebee \
107+ --replace "have optirun" "_have optirun"
108+ '';
109+
103110 preConfigure = ''
104111 # Substitute the path to the actual modinfo program in module.c.
105112 # Note: module.c also calls rmmod and modprobe, but those just have to