How to change version of package and install it

Hello,

I want to install an old version of MasterPDF Editor, and change this line to 5.8.70.

Is there any way i can do it with override/overlay etc?

Thanks

Yeah. Since you’re only changing one package you directly use, and don’t want to change something more fundamental, just modifying the package a bit is enough:

# configuration.nix
{ pkgs, ... }: let
  masterpdfeditor = pkgs.masterpdfeditor.overrideAttrs (old: {
    version = "5.8.70";
    src = fetchurl {
      url = "https://code-industry.net/public/master-pdf-editor-5.8.70-qt5.x86_64.tar.gz";
      hash = "";
    };
  });
in {
  environment.systemPackages = [
    masterpdfeditor
  ];
}

Unfortunately it uses rec, otherwise we could skip redefining quite as much of the source.

YMMV, if the build fails you may have to change the build script a bit.

1 Like