Change:
inherit (lib) optional optionals optionalString versions; in <del> let self = stdenv.mkDerivation rec { pname = "handbrake"; inherit version src; </del> <ins> let self = stdenv.mkDerivation rec { pname = "handbrake"; inherit version src; </ins> <del> postPatch = '' install -Dm444 ${versionFile} ${versionFile.name} </del> <ins> postPatch = '' install -Dm444 ${versionFile} ${versionFile.name} </ins> <del> patchShebangs scripts </del> <ins> patchShebangs scripts </ins> <del> substituteInPlace libhb/hb.c  --replace 'return hb_version;' 'return "${version}";' </del> <ins> substituteInPlace libhb/hb.c  --replace 'return hb_version;' 'return "${version}";' </ins> <del> # Force using nixpkgs dependencies sed -i '/MODULES += contrib/d' make/include/main.defs sed -e 's/^[[:space:]]*(meson|ninja|nasm)[[:space:]]*= ToolProbe.*$//g'  -e '/    ## Additional library and tool checks/,/    ## MinGW specific library and tool checks/d'  -i make/configure.py '' + optionalString stdenv.isDarwin '' # Use the Nix-provided libxml2 instead of the patched version available on # the Handbrake website. substituteInPlace libhb/module.defs  --replace '$(CONTRIB.build/)include/libxml2' ${libxml2.dev}/include/libxml2 </del> <ins> # Force using nixpkgs dependencies sed -i '/MODULES += contrib/d' make/include/main.defs sed -e 's/^[[:space:]]*(meson|ninja|nasm)[[:space:]]*= ToolProbe.*$//g'  -e '/    ## Additional library and tool checks/,/    ## MinGW specific library and tool checks/d'  -i make/configure.py '' + optionalString stdenv.isDarwin '' # Use the Nix-provided libxml2 instead of the patched version available on # the Handbrake website. substituteInPlace libhb/module.defs  --replace '$(CONTRIB.build/)include/libxml2' ${libxml2.dev}/include/libxml2 </ins> <del> # Prevent the configure script from failing if xcodebuild isn't available, # which it isn't in the Nix context. (The actual build goes fine without # xcodebuild.) sed -e '/xcodebuild = ToolProbe/s/abort=.+)/abort=False)/' -i make/configure.py '' + optionalString stdenv.isLinux '' # Use the Nix-provided libxml2 instead of the system-provided one. substituteInPlace libhb/module.defs  --replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2 ''; </del> <ins> # Prevent the configure script from failing if xcodebuild isn't available, # which it isn't in the Nix context. (The actual build goes fine without # xcodebuild.) sed -e '/xcodebuild = ToolProbe/s/abort=.+)/abort=False)/' -i make/configure.py '' + optionalString stdenv.isLinux '' # Use the Nix-provided libxml2 instead of the system-provided one. substituteInPlace libhb/module.defs  --replace /usr/include/libxml2 ${libxml2.dev}/include/libxml2 ''; </ins> <del> nativeBuildInputs = [ autoconf automake libtool m4 pkg-config python3 ] ++ optionals useGtk [ intltool wrapGAppsHook ]; </del> <ins> nativeBuildInputs = [ autoconf automake libtool m4 pkg-config python3 ] ++ optionals useGtk [ intltool wrapGAppsHook ]; </ins> <del> buildInputs = [ a52dec dav1d ffmpeg-hb fontconfig freetype fribidi harfbuzz jansson lame libass libbluray libdvdcss libdvdnav libdvdread libiconv libjpeg_turbo libogg libopus libsamplerate libtheora libvorbis libvpx libxml2 speex x264 x265 xz zimg ] ++ optional (!stdenv.isDarwin) numactl ++ optionals useGtk [ dbus-glib glib gst_all_1.gst-plugins-base gst_all_1.gstreamer gtk3 hicolor-icon-theme libappindicator-gtk3 libgudev libnotify udev ] ++ optional useFdk fdk_aac ++ optionals stdenv.isDarwin [ AudioToolbox Foundation libobjc VideoToolbox ] # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only, # look at ./make/configure.py search "enable_nvenc" ++ optional stdenv.isLinux nv-codec-headers; </del> <ins> buildInputs = [ a52dec dav1d ffmpeg-hb fontconfig freetype fribidi harfbuzz jansson lame libass libbluray libdvdcss libdvdnav libdvdread libiconv libjpeg_turbo libogg libopus libsamplerate libtheora libvorbis libvpx libxml2 speex svt-av1 x264 x265 xz zimg ] ++ optional (!stdenv.isDarwin) numactl ++ optionals useGtk [ dbus-glib glib gst_all_1.gst-plugins-base gst_all_1.gstreamer gtk3 hicolor-icon-theme libappindicator-gtk3 libgudev libnotify udev ] ++ optional useFdk fdk_aac ++ optionals stdenv.isDarwin [ AudioToolbox Foundation libobjc VideoToolbox ] # NOTE: 2018-12-27: Handbrake supports nv-codec-headers for Linux only, # look at ./make/configure.py search "enable_nvenc" ++ optional stdenv.isLinux nv-codec-headers; </ins> <del> configureFlags = [ "--disable-df-fetch" "--disable-df-verify" "--disable-gtk-update-checks" ] ++ optional (!useGtk) "--disable-gtk" ++ optional useFdk "--enable-fdk-aac" ++ optional stdenv.isDarwin "--disable-xcode" ++ optional stdenv.hostPlatform.isx86 "--harden"; </del> <ins> configureFlags = [ "--disable-df-fetch" "--disable-df-verify" "--disable-gtk-update-checks" ] ++ optional (!useGtk) "--disable-gtk" ++ optional useFdk "--enable-fdk-aac" ++ optional stdenv.isDarwin "--disable-xcode" ++ optional stdenv.hostPlatform.isx86 "--harden"; </ins> <del> # NOTE: 2018-12-27: Check NixOS HandBrake test if changing NIX_LDFLAGS = [ "-lx265" ]; </del> <ins> # NOTE: 2018-12-27: Check NixOS HandBrake test if changing NIX_LDFLAGS = [ "-lx265" ]; </ins> <del> makeFlags = [ "--directory=build" ]; </del> <ins> makeFlags = [ "--directory=build" ]; </ins> <del> passthru.tests = { basic-conversion = let # Big Buck Bunny example, licensed under CC Attribution 3.0. testMkv = fetchurl { url = "https://github.com/Matroska-Org/matroska-test-files/blob/cf0792be144ac470c4b8052cfe19bb691993e3a2/test_files/test1.mkv?raw=true"; sha256 = "1hfxbbgxwfkzv85pvpvx55a72qsd0hxjbm9hkl5r3590zw4s75h9"; }; in runCommand "${pname}-${version}-basic-conversion" { nativeBuildInputs = [ self ]; } '' mkdir -p $out cd $out HandBrakeCLI -i ${testMkv} -o test.mp4 -e x264 -q 20 -B 160 test -e test.mp4 HandBrakeCLI -i ${testMkv} -o test.mkv -e x264 -q 20 -B 160 test -e test.mkv ''; version = testers.testVersion { package = self; command = "HandBrakeCLI --version"; }; }; </del> <ins> passthru.tests = { basic-conversion = let # Big Buck Bunny example, licensed under CC Attribution 3.0. testMkv = fetchurl { url = "https://github.com/Matroska-Org/matroska-test-files/blob/cf0792be144ac470c4b8052cfe19bb691993e3a2/test_files/test1.mkv?raw=true"; sha256 = "1hfxbbgxwfkzv85pvpvx55a72qsd0hxjbm9hkl5r3590zw4s75h9"; }; in runCommand "${pname}-${version}-basic-conversion" { nativeBuildInputs = [ self ]; } '' mkdir -p $out cd $out HandBrakeCLI -i ${testMkv} -o test.mp4 -e x264 -q 20 -B 160 test -e test.mp4 HandBrakeCLI -i ${testMkv} -o test.mkv -e x264 -q 20 -B 160 test -e test.mkv ''; version = testers.testVersion { package = self; command = "HandBrakeCLI --version"; }; }; </ins> <del> meta = with lib; { homepage = "https://handbrake.fr/"; description = "A tool for converting video files and ripping DVDs"; longDescription = '' Tool for converting and remuxing video files into selection of modern and widely supported codecs and containers. Very versatile and customizable. Package provides: CLI - `HandbrakeCLI` GTK GUI - `ghb` ''; license = licenses.gpl2Only; maintainers = with maintainers; [ Anton-Latukha wmertens ]; platforms = with platforms; unix; broken = stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13"; </del> <ins> meta = with lib; { homepage = "https://handbrake.fr/"; description = "A tool for converting video files and ripping DVDs"; longDescription = '' Tool for converting and remuxing video files into selection of modern and widely supported codecs and containers. Very versatile and customizable. Package provides: CLI - `HandbrakeCLI` GTK GUI - `ghb` ''; license = licenses.gpl2Only; maintainers = with maintainers; [ Anton-Latukha wmertens ]; platforms = with platforms; unix; broken = stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13"; }; </ins> }; <del> }; in self </del> <ins> in self </ins>

Discussion:
As title says, the ffmpeg that handbrake uses can't be built, complaining about missing sdl2. Steps to reproduce the behavior: to install handbrake the error Handbrake is installable If applicable, add screenshots to help explain your problem. Please run and paste the result.
Try with this patch:
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
sorry i missed this, I don't know how can I try that?
I am getting a similar error, after running a channel update on the unstable channel.
Here to report the same issues, specifically seems to fail with . Here's the errors: Results of : Might be worth reopening.
This is a different issue and already fixed in nixos-unstable-small and should be in normal nixos-unstable shortly.
Sounds great, appreciate the heads up.