微信可以单独打包一个墙内下载地址的版本吗?

如题,我昨晚在安装微信时发现微信会需要在_web.archieve.org_上下载appimage包,这导致我安装微信一直因为网络问题而装不上,请问微信可以单独打包一个墙内可以下载的版本或者可以重新打包微信吗?

直接覆盖一下src就行了

environment.systemPackages = with pkgs; [
  (wechat.overrideAttrs {
    src = fetchurl {
      url = "https://dldir1v6.qq.com/weixin/Universal/Linux/WeChatLinux_x86_64.AppImage";
      hash = "sha256-+r5Ebu40GVGG2m2lmCFQ/JkiDsN/u7XEtnLrB98602w=";
    };
  })
];
2 Likes

感谢解答。不过我看qq的打包都是直接用的腾讯的下载的地址的,微信用achieve.org是有什么难言之隐吗?

腾讯官方的下载链接会时不时更新背后的实际软件包,会导致hash mismatch,所以目前我们使用互联网档案馆(IA)的时光机功能去保存某个具体时间的安装包来去保证hash的稳定性。目前这么做相对可靠,但有些时候还是会有法律上和实际执行层面上的问题(比如IA的链接也不是完全免于替换的,而且IA提供的服务本来不是为了给Nixpkgs提供更高的可复现性保证,所以我们这样用有可能会违反IA的使用条例。详见 Discussing the legality/viability of using the Wayback Machine to freeze proprietary download links · Issue #359366 · NixOS/nixpkgs · GitHub

As @pluiedev said, the upstream link is not versioned and not stable like wechat for darwin. Therefore we have to use a snapshot service to pin to specific versions (and currently we use Wayback Machine), this may cause issues if your connections are problematic, but due to the nature of FODs you can override the package and download from any sources as you see fit (as in @FrdrCkII’s reply), as long as the hash of the resulting derivation is not changed.