diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index 6b0d3d12e5e3..60255d21bcb1 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -107,7 +107,7 @@ let ++ lib.optionals (lib.versionAtLeast version "17.0.0") [ libGL vulkan-loader ] ); - linux = { + linux = finalAttrs: { buildInputs = [ glib gtk3 ]; nativeBuildInputs = [ @@ -142,9 +142,11 @@ let rm "$out/libexec/electron/libvulkan.so.1" ln -s -t "$out/libexec/electron" "${lib.getLib vulkan-loader}/lib/libvulkan.so.1" ''; + + passthru.dist = finalAttrs.finalPackage + "/libexec/electron"; }; - darwin = { + darwin = finalAttrs: { nativeBuildInputs = [ makeWrapper unzip @@ -157,9 +159,12 @@ let mkdir -p $out/bin makeWrapper $out/Applications/Electron.app/Contents/MacOS/Electron $out/bin/electron ''; + + passthru.dist = finalAttrs.finalPackage + "/Applications"; }; in - stdenv.mkDerivation ( - (common stdenv.hostPlatform) // - (if stdenv.isDarwin then darwin else linux) + stdenv.mkDerivation (finalAttrs: + lib.recursiveUpdate + (common stdenv.hostPlatform) + ((if stdenv.isDarwin then darwin else linux) finalAttrs) ) diff --git a/pkgs/development/tools/electron/common.nix b/pkgs/development/tools/electron/common.nix index 1e863827710d..e98e93a0a17d 100644 --- a/pkgs/development/tools/electron/common.nix +++ b/pkgs/development/tools/electron/common.nix @@ -27,7 +27,7 @@ let fetchedDeps = lib.mapAttrs (name: fetchdep) info.deps; -in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: { +in ((chromium.override { upstream-info = info.chromium; }).mkDerivation (base: { packageName = "electron"; inherit (info) version; buildTargets = [ "electron:electron_dist_zip" ]; @@ -244,4 +244,9 @@ in (chromium.override { upstream-info = info.chromium; }).mkDerivation (base: { hydraPlatforms = lib.optionals (!(hasInfix "alpha" info.version) && !(hasInfix "beta" info.version)) ["aarch64-linux" "x86_64-linux"]; timeout = 172800; # 48 hours (increased from the Hydra default of 10h) }; +})).overrideAttrs (finalAttrs: prevAttrs: { + # this was the only way I could get the package to properly reference itself + passthru = prevAttrs.passthru // { + dist = finalAttrs.finalPackage + "/libexec/electron"; + }; }) diff --git a/pkgs/development/tools/electron/wrapper.nix b/pkgs/development/tools/electron/wrapper.nix index c912c059e255..8c48e8f695fc 100644 --- a/pkgs/development/tools/electron/wrapper.nix +++ b/pkgs/development/tools/electron/wrapper.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation { passthru = { unwrapped = electron-unwrapped; - inherit (electron-unwrapped) headers; + inherit (electron-unwrapped) headers dist; }; inherit (electron-unwrapped) meta; }