Using overrideAttrs for kodi addons

I would like to try to update the youtube kodi addon to the latest version, but if I try to use something like this

  myKodi = with pkgs; (kodi-gbm.withPackages (p: with p; [
    (youtube.overrideAttrs (old: rec {
      version = "7.1.1.3";
      src = old.src.override rec {
        owner = "anxdpanic";
        repo = "plugin.video.youtube";
        rev = "v${version}";   # same problem using also the explicit version
        #hash = "sha256-";
      };
    }))
    #[... other addons ...]]]
  ]));

still version youtube-7.1.0.1 is built, and I don’t understand why (I was expecting an error due to the hash changed). Do you know what is going on? Is it maybe because the addons are created using the buildKodiAddon/toKodiAddon machinery and the derivation looks different?

Thanks

Classic FOD moment. Set hash = ""; here.

Amazing (and thanks!), I was expecting a default (wrong) value for the hash or some other error, but not “skipping” my request to create a derivation. What caused that?

I also noticed that I have this output

[ERROR]   stderr) trying https://github.com/anxdpanic/plugin.video.youtube/archive/v7.1.1.3.tar.gz
[ERROR]   stderr)   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[ERROR]   stderr)                                  Dload  Upload   Total   Spent    Left  Speed
[ERROR]   stderr)   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ERROR]   stderr) 100  586k    0  586k    0     0   893k      0 --:--:-- --:--:-- --:--:--  893k
[ERROR]   stderr) unpacking source archive /build/v7.1.1.3.tar.gz
[ERROR]   stderr) error: hash mismatch in fixed-output derivation '/nix/store/zd6bk341fcc72gjh5arjhlrbfy5k3fqc-source.drv':
[ERROR]   stderr)          specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
[ERROR]   stderr)             got:    sha256-5zl0z3DoyLp+MdYyOmLR1TfogOfI0AAcjqc+abeSGPM=
[ERROR]   stderr) error: 1 dependencies of derivation '/nix/store/j139zsk9lr1nxid8xidv6lsbxalc39yg-kodi-youtube-7.1.0.1.drv' failed to build

so the source is the correct one (7.1.1.3), but the derivation version is still wrong (7.1.0.1)? What am I missing?

ok, adding a name = "youtube-${version}"; fixed the naming problem

https://nix.dev/manual/nix/2.24/language/advanced-attributes.html?highlight=fixed-ou#adv-attr-outputHash

For fixed-output derivations, on the other hand, the name of the output path only depends on the outputHash* and name attributes, while all other attributes are ignored for the purpose of computing the output path.

i.e. changing URLs doesn’t invalidate FOD hashes

Thanks! Now I understand what you meant with FOD