Overriding Jetbrains package versions

Hi, new-ish to NixOS here.
I use Jetbrains Rider and noticed that the ‘jetbrains.rider’ package does not currently install the latest version.
So I thought I could maybe override the version somehow locally.
I went to check the nix source code at https://github.com/NixOS/nixpkgs/blob/f2c62a920f99c7f657dd1e84ee6ce58bfea1775c/pkgs/applications/editors/jetbrains/default.nix but it doesn’t seem to be overridable?
I tried:

     (jetbrains.rider.override rec {
       version = "2019.3.4";
       src = fetchurl {
        url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
        sha256 = "0cs8fc3h6d2m84ppiqjy0f3xklpc5gf0i6c4bzv04y8ngh0cwgl2";
      };
     })

but it throws:

error: anonymous function at /nix/store/1y339mhzlflkd5w9mdms9j8yrg4w3wq0-source/pkgs/applications/editors/jetbrains/default.nix:1:1 called with unexpected argument 'version', at /nix/store/1y339mhzlflkd5w9mdms9j8yrg4w3wq0-source/lib/customisation.nix:133:63

Also am I right in thinking that the buildRider function isn’t public so I can’t call it? If so, why?

Thanks

I would have thought that should work too, since override is for overriding a function argument set, and version is clearly an argument to buildRider. I’m still trying to grasp this, but my guess is that since buildRider is ultimately a mkDerivation function, you should use overrideAttrs. But overrideAttrs is not available for jetbrains.rider - probably because buildRider starts off with an overrideDerivation. I finally managed to get it working with this overlay:

(self: super:
  {
    jetbrains = super.jetbrains // {
      rider = super.jetbrains.rider.overrideDerivation (_: rec {
        name = "rider-${version}";
        version = "2020.1.3";

        src = super.fetchurl {
          url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
          sha256 = "1zzkd3b5j3q6jqrvibxz33a4fcm7pgqfx91bqjs615v3499ncng7";
        };
      });
    };
  }
)

As far as I understand, dropping the super.jetbrains // and using overrideAttrs instead of overrideDerivation is preferred over this, but as I said, overrideAttrs is not available.

1 Like