I'm failing to use an overlay with requireFile

While waiting for the ndi update to be merged I was trying to override it using an overlay.

It doesn’t seem to be working.

I’m using nixus.

self: super:
{
  my_ndi = super.ndi.overrideAttrs (old: {
    fullVersion = "4.5.3";
    src = self.requireFile {
      name    = "InstallNDISDK_v4_Linux.tar.gz";
      sha256  = "0w9f4a4a3xzg0nvmvrlda1wwkyi0m5aqvk07immmwgg7f1z1sqj5";
      message = "something";
    };
  });
}

Note that the error message still says “4.5.1” and not “4.5.3”.

these derivations will be built:
  /nix/store/qvhplhwzj79q3d1p2fn422i7fvwffzvb-InstallNDISDK_v4_Linux.tar.gz.drv
  /nix/store/3bl3gkf3ardw0ay6h8lbysm2af45sanb-ndi-4.5.3.drv
  /nix/store/36fy79kvswsws99z85ajjwv32pmzbj58-home-manager-path.drv
  /nix/store/qvn7256wmi2am88x6h3i7vzbj9ycrwd4-activation-script.drv
  /nix/store/ahq7rfbn74v1hhsx4jmmwxiy4frwpgbj-ndi-4.5.3-fish-completions.drv
  /nix/store/70mk1yd23bgc0qvkvwq5ig3rs78876wv-bbigras-fish-completions.drv
  /nix/store/sc9znvvsq5liq4k5lkc5pdhf2xqwfmnc-home-manager-files.drv
  /nix/store/z4hv0k9fijvklbjmcy0sbh3b0fa6f8s3-home-manager-generation.drv
  /nix/store/9x38l5s572ac9rldbdg730x8glj0z1yv-activate-bbigras.drv
  /nix/store/gwyc49h4rhs2yr9mv1hnafdxjxi4m5pg-unit-home-manager-bbigras.service.drv
  /nix/store/mjr0kdwsab0b68bxyk3zppqmrr2mj0g2-system-units.drv
  /nix/store/4ssg4k051320vcdyg9ahs4y77mdkyfjf-etc.drv
  /nix/store/n308qrf5ri71w0h0p6knk6h4xf8hdlb7-nixos-system-laptop-20.09pre-git.drv
  /nix/store/vn8q9j1885hgzn3jrma258dqqd840grh-required-secrets.drv
  /nix/store/1bi2c4yslhr4hm7jzgfh3gq2c5grqlv6-deploy-laptop.drv
building '/nix/store/qvhplhwzj79q3d1p2fn422i7fvwffzvb-InstallNDISDK_v4_Linux.tar.gz.drv'...

***
In order to use NDI SDK version 4.5.1, you need to comply with
NewTek's license and download the appropriate Linux tarball from:

  https://ndi.tv/sdk/

Once you have downloaded the file, please use the following command and
re-run the installation:

  $ nix-prefetch-url file://$PWD/InstallNDISDK_v4_Linux.tar.gz

***

Interesting… I just read a discussion about how rec and overrideAttrs sometimes act weird: Avoid rec expresions in nixpkgs?

How about using src = super.fetchurl { url = "file:///...." }; Or perhaps you can even use the builtin: filterSource: https://nixos.org/nix/manual/#builtin-filterSource

with:

    src = super.fetchurl {
      url = "file:///home/bbigras/Downloads/InstallNDISDK_v4_Linux.tar.gz";
      sha256  = "0w9f4a4a3xzg0nvmvrlda1wwkyi0m5aqvk07immmwgg7f1z1sqj5";
    };

or src = ./InstallNDISDK_v4_Linux.tar.gz;

I have the same problem.

I’m guessing the overlay is used since nix-build complained when sha256 was missing with fetchurl.

Maybe I’m doing something wrong.