Nixpkgs overlay for mpd-discord-rpc is no longer working

hello all!! I had an overlay for mpd-discord-rpc to make it use the latest from git (has a change that I wanted), i had it like so which was working for a few months:

      package = pkgs.mpd-discord-rpc.overrideAttrs (oldAttrs: rec {
        pname = "mpd-discord-rpc-git";
        src = npins.mpd-discord-rpc;
        cargoDeps = oldAttrs.cargoDeps.overrideAttrs {
          inherit src;
          outputHash = "sha256-uDru6npxi+NU/KzCa8uoGqvLrJwMB+PGWl7rneyubCY=";
        };
      });

My full config for mpd-discord-rpc is available here: home/modules/music/mpd/mpd-discord-rpc/default.nix · main · Fazzi / NixOhEss · GitLab

however after updating last night (and adding an overlay for that basedpyright build failure), this no longer works, i get this error on rebuild:

mpd-discord-rpc-1.7.3-vendor> Unpacking to /nix/store/q1hkj0884jhch9g80k1yigvglixsi5p1-mpd-discord-rpc-1.7.3-vendor/zerocopy-derive-0.7.32
error: output path '/nix/store/a58jwn5pbh869j8xmyrmiswm38pgl0my-mpd-discord-rpc-1.7.3-vendor.drv.chroot/root/nix/store/q1hkj0884jhch9g80k1yigvglixsi5p1-mpd-discord-rpc-1.7.3-vendor' should be a non-executable regular file since recursive hashing is not enabled (one of outputHashMode={flat,text} is true)
error: 1 dependencies of derivation '/nix/store/bxxmzg37mkb78p51ai32nvav65szpj71-mpd-discord-rpc-git-1.7.3.drv' failed to build

Is this a change in nixos which is causing my overlay to no longer work? I am on nixos-unstable, and commenting out this package override does make it build fine. There were no changes to upstream mpd-discord-rpc between this working and being broken either.

So how can I get this working again? Any help would be greatly appreciated :slight_smile:

1 Like

You should not try to override fetch* functions (including cargoDeps), here is the right overlay

      package = pkgs.mpd-discord-rpc.overrideAttrs (oldAttrs: rec {
        pname = "mpd-discord-rpc-git";
        src = npins.mpd-discord-rpc;
        cargoDeps = final.rustPlatform.fetchCargoVendor {
          inherit src;
          hash = "sha256-uDru6npxi+NU/KzCa8uoGqvLrJwMB+PGWl7rneyubCY=";
        };
      });
2 Likes

when did this change?

because previously the infamous crago256Hash discourse thread has overriding cargoDeps as the solution Is it possible to override cargoSha256 in buildRustPackage? - #3 by aszlig.

This is what I originally followed. Hence why it was my original working solution. It stopped working within the past 2 or 3 weeks