Change:
Attempt to build on Sample This is on an M2 chip, and it seems the issue is with node-canvas not being able to install due to missing giflib. Building with: Fixes this. Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:

Discussion:
<del> { lib , stdenv , fetchFromGitHub , buildNpmPackage , nix-update-script , electron , writeShellScriptBin , makeWrapper , copyDesktopItems , giflib , makeDesktopItem , pkg-config , pixman , cairo , pango , npm-lockfile-fix , overrideSDK , darwin </del> <ins> { lib, stdenv, fetchFromGitHub, buildNpmPackage, nix-update-script, electron, writeShellScriptBin, makeWrapper, copyDesktopItems, makeDesktopItem, pkg-config, pixman, cairo, pango, npm-lockfile-fix, overrideSDK, darwin, </ins> }: let # fix for: https://github.com/NixOS/nixpkgs/issues/272156 <del> buildNpmPackage' = buildNpmPackage.override { stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; }; </del> <ins> buildNpmPackage' = buildNpmPackage.override { stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; }; </ins> in buildNpmPackage' rec { pname = "bruno";

npmDepsHash = "sha256-157hm7h5FWuOuxoo6WTtlMPq5LcRZIsSt5NDg0pvim8="; npmFlags = [ "--legacy-peer-deps" ]; <del> nativeBuildInputs = [ (writeShellScriptBin "phantomjs" "echo 2.1.1") pkg-config ] ++ lib.optionals (! stdenv.isDarwin) [ makeWrapper copyDesktopItems ]; buildInputs = [ pixman cairo pango ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk_11_0.frameworks.CoreText giflib ]; </del> <ins> nativeBuildInputs = [ (writeShellScriptBin "phantomjs" "echo 2.1.1") pkg-config ] ++ lib.optionals (!stdenv.isDarwin) [ makeWrapper copyDesktopItems ]; buildInputs = [ pixman cairo pango ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk_11_0.frameworks.CoreText ]; </ins> desktopItems = [ (makeDesktopItem {

--replace-fail 'if [ "$1" == "snap" ]; then' 'exit 0; if [ "$1" == "snap" ]; then' ''; <del> ELECTRON_SKIP_BINARY_DOWNLOAD=1; </del> <ins> ELECTRON_SKIP_BINARY_DOWNLOAD = 1; # remove giflib dependency npmRebuildFlags = [ "--ignore-scripts" ]; preBuild = '' substituteInPlace node_modules/canvas/binding.gyp  --replace-fail "'with_gif%': '<!(node ./util/has_lib.js gif)'" "'with_gif%': 'false'" npm rebuild ''; </ins> dontNpmBuild = true; postBuild = ''

pushd packages/bruno-electron <del> ${if stdenv.isDarwin then '' cp -r ${electron}/Applications/Electron.app ./ find ./Electron.app -name 'Info.plist' | xargs -d 'n' chmod +rw substituteInPlace electron-builder-config.js  --replace-fail "identity: 'Anoop MD (W7LPPWA48L)'" 'identity: null'  --replace-fail "afterSign: 'notarize.js'," "" npm exec electron-builder --  --dir  --config electron-builder-config.js  -c.electronDist=./  -c.electronVersion=${electron.version}  -c.npmRebuild=false '' else '' npm exec electron-builder --  --dir  -c.electronDist=${electron}/libexec/electron  -c.electronVersion=${electron.version}  -c.npmRebuild=false ''} </del> <ins> ${ if stdenv.isDarwin then '' cp -r ${electron}/Applications/Electron.app ./ find ./Electron.app -name 'Info.plist' | xargs -d 'n' chmod +rw substituteInPlace electron-builder-config.js  --replace-fail "identity: 'Anoop MD (W7LPPWA48L)'" 'identity: null'  --replace-fail "afterSign: 'notarize.js'," "" npm exec electron-builder --  --dir  --config electron-builder-config.js  -c.electronDist=./  -c.electronVersion=${electron.version}  -c.npmRebuild=false '' else '' npm exec electron-builder --  --dir  -c.electronDist=${electron}/libexec/electron  -c.electronVersion=${electron.version}  -c.npmRebuild=false '' } </ins> popd '';

runHook preInstall <del> ${if stdenv.isDarwin then '' mkdir -p $out/Applications </del> <ins> ${ if stdenv.isDarwin then '' mkdir -p $out/Applications </ins> <del> cp -R packages/bruno-electron/out/**/Bruno.app $out/Applications/ '' else '' mkdir -p $out/opt/bruno $out/bin </del> <ins> cp -R packages/bruno-electron/out/**/Bruno.app $out/Applications/ '' else '' mkdir -p $out/opt/bruno $out/bin </ins> <del> cp -r packages/bruno-electron/dist/linux*-unpacked/{locales,resources{,.pak}} $out/opt/bruno </del> <ins> cp -r packages/bruno-electron/dist/linux*-unpacked/{locales,resources{,.pak}} $out/opt/bruno </ins> <del> makeWrapper ${lib.getExe electron} $out/bin/bruno  --add-flags $out/opt/bruno/resources/app.asar  --add-flags "''${NIXOS_OZONE_WL:+''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"  --set-default ELECTRON_IS_DEV 0  --inherit-argv0 </del> <ins> makeWrapper ${lib.getExe electron} $out/bin/bruno  --add-flags $out/opt/bruno/resources/app.asar  --add-flags "''${NIXOS_OZONE_WL:+''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"  --set-default ELECTRON_IS_DEV 0  --inherit-argv0 </ins> <del> for s in 16 32 48 64 128 256 512 1024; do size=${"$"}{s}x$s install -Dm644 $src/packages/bruno-electron/resources/icons/png/$size.png $out/share/icons/hicolor/$size/apps/bruno.png done ''} </del> <ins> for s in 16 32 48 64 128 256 512 1024; do size=${"$"}{s}x$s install -Dm644 $src/packages/bruno-electron/resources/icons/png/$size.png $out/share/icons/hicolor/$size/apps/bruno.png done '' } </ins> runHook postInstall '';

homepage = "https://www.usebruno.com"; platforms = platforms.linux ++ platforms.darwin; license = licenses.mit; <del> maintainers = with maintainers; [ gepbird kashw2 lucasew mattpolzin water-sucks redyf ]; </del> <ins> maintainers = with maintainers; [ gepbird kashw2 lucasew mattpolzin water-sucks redyf ]; </ins> mainProgram = "bruno"; }; }