How to install a package that was manually downloaded?

You can override the src attribute of it using overrideAttrs. I read through the derivation for vmware-workstation and it looks like the unpackPhase refers to the src attribute, so the unpackPhase attribute would also need to be overridden. The following code got it past the unpack phase, but I didn’t let it build until the end:

(pkgs.vmware-workstation.overrideAttrs rec {
  src = ./vmware.bundle;
  unpackPhase = let
    vmware-unpack-env = pkgs.buildFHSEnv rec {
      name = "vmware-unpack-env";
      targetPkgs = pkgs: [ pkgs.zlib ];
    };
  in ''
    ${vmware-unpack-env}/bin/vmware-unpack-env -c "sh ${src} --extract unpacked"
    # If you need it, copy the enableMacOSGuests stuff here as well.
  '';
})

For use with the vmware NixOS module, see my comment #9 in this thread.

3 Likes