Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

59 lines
1.6 KiB
Nix

{
lib,
fetchzip,
stdenvNoCC,
writeShellApplication,
curl,
xmlstarlet,
common-updater-scripts,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "whatsapp-for-mac";
version = "2.25.22.79";
src = fetchzip {
extension = "zip";
name = "WhatsApp.app";
url = "https://web.whatsapp.com/desktop/mac_native/release/?version=${finalAttrs.version}&extension=zip&configuration=Release&branch=relbranch";
hash = "sha256-LYjPMiXLD1U5ZNt/acBagrV2RS7U/OGMJ06mUFBluSQ=";
};
dontConfigure = true;
dontBuild = true;
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p "$out/Applications"
cp -r *.app "$out/Applications"
runHook postInstall
'';
passthru.updateScript = lib.getExe (writeShellApplication {
name = "whatsapp-update-script";
runtimeInputs = [
curl
xmlstarlet
common-updater-scripts
];
text = ''
url=$(curl --silent "https://web.whatsapp.com/desktop/mac_native/updates/?branch=relbranch&configuration=Release")
version=$(echo "$url" | xmlstarlet sel -t -v "substring-before(substring-after(//enclosure/@url, 'version='), '&')")
update-source-version whatsapp-for-mac "$version" --file=./pkgs/by-name/wh/whatsapp-for-mac/package.nix
'';
});
meta = {
description = "Native desktop client for WhatsApp";
homepage = "https://www.whatsapp.com/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ iivusly ];
platforms = lib.platforms.darwin;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})