From 4d3f28abcefa9b09a4694d9d61f9c9ab5d7da822 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 20 Jul 2025 12:28:36 +0200 Subject: [PATCH] zoom-us: avoid manual throw Relying on `meta.platforms` to throw errors on unsupported platforms (here: aarch64-linux) allows CI to filter out these attrpaths without hitting an error on evaluation. --- pkgs/by-name/zo/zoom-us/package.nix | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 318eae02bd6c..740dec92b317 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -55,7 +55,6 @@ let inherit (stdenv.hostPlatform) system; - throwSystem = throw "Unsupported system: ${system}"; # Zoom versions are released at different times for each platform # and often with different versions. We write them on three lines @@ -83,9 +82,9 @@ let unpacked = stdenv.mkDerivation { pname = "zoom"; - version = versions.${system} or throwSystem; + version = versions.${system} or ""; - src = srcs.${system} or throwSystem; + src = srcs.${system}; dontUnpack = stdenv.hostPlatform.isLinux; unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' @@ -129,7 +128,7 @@ let mv $out/usr/* $out/ ''; } - .${system} or throwSystem + .${system} } runHook postInstall ''; @@ -159,8 +158,6 @@ let mainProgram = "zoom"; }; }; - packages.aarch64-darwin = unpacked; - packages.x86_64-darwin = unpacked; # linux definitions @@ -237,13 +234,17 @@ let ++ targetPkgs pkgs ++ targetPkgsFixed; +in +if !stdenv.hostPlatform.isLinux then + unpacked +else # We add the `unpacked` zoom archive to the FHS env # and also bind-mount its `/opt` directory. # This should assist Zoom in finding all its # files in the places where it expects them to be. - packages.x86_64-linux = buildFHSEnv { + buildFHSEnv { pname = "zoom"; # Will also be the program's name! - version = versions.${system} or throwSystem; + version = versions.${system} or ""; targetPkgs = pkgs: (linuxGetDependencies pkgs) ++ [ unpacked ]; extraBwrapArgs = [ "--ro-bind ${unpacked}/opt /opt" ]; @@ -263,8 +264,4 @@ let inherit unpacked; }; inherit (unpacked) meta; - }; - -in - -packages.${system} or throwSystem + }