Using NixOS unstable and flakes.
I am trying to use an overlay to override the source for pkgs.yt-dlp to point to the source for the latest (at time of writing) nightly build. The overlay is defined in a module which is imported into my configuration.nix file.
Module with overlay:
{ config, pkgs, ... }: {
nixpkgs.overlays = [
(final: prev: {
yt-dlp = prev.yt-dlp.overrideAttrs (
finalAttrs: prevAttrs: {
version = "2026.09.16.232951";
src = pkgs.fetchzip {
url = "https://github.com/yt-dlp/yt-dlp-nightly-builds/releases/download/${finalAttrs.version}/yt-dlp.tar.gz";
hash = "sha256-eN6wNEdXOFuwjW0hB3OQMDUROvtNd3QV/O8kqbr/kug=";
};
}
);
})
];
}
The build fails when the fixupPhase tries to mv doc files frome one store paths to a nonempty directory in another store path.
Error:
> Moving /nix/store/k13z0dyw95nlpq5895lgk4ynqq8p7257-yt-dlp-2026.09.16.232951/share/doc to /nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc
> mv: cannot overwrite '/nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc/yt_dlp': Directory not empty
To make sure this was not being caused by some junk left over from a previous failed build, I ran nix-store --gc and verified that the paths in the error were removed from /nix/store. I tried the build again and got the same error. I have no problems when building yt-dlp using the original source in pkgs.yt-dlp. This only happens with the nightly source. Does anyone know how to resolve this? Any help would be appreciated.
Relevant error logs:
building '/nix/store/cvja0fj6b9hvrryam61rcdd2zjfj4c6c-yt-dlp-2026.09.16.232951.drv'...
error: Cannot build '/nix/store/cvja0fj6b9hvrryam61rcdd2zjfj4c6c-yt-dlp-2026.09.16.232951.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/4w0n6picp1i39lylhy7gd1270q399j71-yt-dlp-2026.09.16.232951-dist
/nix/store/k13z0dyw95nlpq5895lgk4ynqq8p7257-yt-dlp-2026.09.16.232951
/nix/store/r8s423jx6xcrisgfgny8ck4ryqakg7x3-yt-dlp-2026.09.16.232951-man
/nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc
Last 25 log lines:
> Creating a wheel...
> pypa build flags: --no-isolation --outdir dist/ --wheel
> * Getting build dependencies for wheel...
> * Building wheel...
> Successfully built yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished creating a wheel...
> /build/source/dist /build/source
> Unpacking to: unpacked/yt_dlp-2026.9.16.232951...OK
> Repacking wheel as ./yt_dlp-2026.9.16.232951-py3-none-any.whl...OK
> /build/source
> Finished executing pypaBuildPhase
> Running phase: pythonRuntimeDepsCheckHook
> Executing pythonRuntimeDepsCheck
> Checking runtime dependencies for yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished executing pythonRuntimeDepsCheck
> Running phase: installPhase
> Executing pypaInstallPhase
> Successfully installed yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished executing pypaInstallPhase
> Running phase: pythonOutputDistPhase
> Executing pythonOutputDistPhase
> Finished executing pythonOutputDistPhase
> Running phase: fixupPhase
> Moving /nix/store/k13z0dyw95nlpq5895lgk4ynqq8p7257-yt-dlp-2026.09.16.232951/share/doc to /nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc
> mv: cannot overwrite '/nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc/yt_dlp': Directory not empty
For full logs, run:
nix log /nix/store/cvja0fj6b9hvrryam61rcdd2zjfj4c6c-yt-dlp-2026.09.16.232951.drv
error: Cannot build '/nix/store/cvja0fj6b9hvrryam61rcdd2zjfj4c6c-yt-dlp-2026.09.16.232951.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/4w0n6picp1i39lylhy7gd1270q399j71-yt-dlp-2026.09.16.232951-dist
/nix/store/k13z0dyw95nlpq5895lgk4ynqq8p7257-yt-dlp-2026.09.16.232951
/nix/store/r8s423jx6xcrisgfgny8ck4ryqakg7x3-yt-dlp-2026.09.16.232951-man
/nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc
Last 25 log lines:
> Creating a wheel...
> pypa build flags: --no-isolation --outdir dist/ --wheel
> * Getting build dependencies for wheel...
> * Building wheel...
> Successfully built yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished creating a wheel...
> /build/source/dist /build/source
> Unpacking to: unpacked/yt_dlp-2026.9.16.232951...OK
> Repacking wheel as ./yt_dlp-2026.9.16.232951-py3-none-any.whl...OK
> /build/source
> Finished executing pypaBuildPhase
> Running phase: pythonRuntimeDepsCheckHook
> Executing pythonRuntimeDepsCheck
> Checking runtime dependencies for yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished executing pythonRuntimeDepsCheck
> Running phase: installPhase
> Executing pypaInstallPhase
> Successfully installed yt_dlp-2026.9.16.232951-py3-none-any.whl
> Finished executing pypaInstallPhase
> Running phase: pythonOutputDistPhase
> Executing pythonOutputDistPhase
> Finished executing pythonOutputDistPhase
> Running phase: fixupPhase
> Moving /nix/store/k13z0dyw95nlpq5895lgk4ynqq8p7257-yt-dlp-2026.09.16.232951/share/doc to /nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc
> mv: cannot overwrite '/nix/store/whpphr7qr79jxblz7jdvc12sn0h6d6da-yt-dlp-2026.09.16.232951-doc/share/doc/yt_dlp': Directory not empty
For full logs, run:
nix log /nix/store/cvja0fj6b9hvrryam61rcdd2zjfj4c6c-yt-dlp-2026.09.16.232951.drv
error: Cannot build '/nix/store/xqw2x9icycbc5z18szi11jiklzcd4ca8-system-path.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/vmdzm8dsa00wsmnw4k7aiayjrg6sd644-system-path
error: Cannot build '/nix/store/84qy87q02w3xwci6x6acw785wz5xycfr-nixos-system-blackbox-26.11.20260923.4975466.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/79g71xvdj41f1ki7r66s8hirqcg65s72-nixos-system-blackbox-26.11.20260923.4975466
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/user/user/nixos#nixosConfigurations."blackbox".config.system.build.toplevel' --no-link' returned non-zero exit status 1.