22 src = fetchFromGitHub {
26 hash = "sha256-VZRVmOJkNjZLpIG5oBIbDVJl8EZhOtBMywwJKdfD9Hc=";
29 ${lib.getExe npm-lockfile-fix} $out/package-lock.json
33 npmDepsHash = "sha256-qgg/dpkBAbOgBeGC0BiKQTyLsOOKwfsJD3fhs/cXYHo=";
34 npmFlags = [ "--legacy-peer-deps" ];
40 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
54 desktopName = "Bruno";
57 comment = "Opensource API Client for Exploring and Testing APIs";
58 categories = [ "Development" ];
59 startupWMClass = "Bruno";
64 substituteInPlace scripts/build-electron.sh \
65 --replace-fail 'if [ "$1" == "snap" ]; then' 'exit 0; if [ "$1" == "snap" ]; then'
68 substituteInPlace packages/bruno-app/src/providers/App/index.js \
69 --replace-fail "useTelemetry();" ""
73 # sh: line 1: /build/source/packages/bruno-common/node_modules/.bin/rollup: cannot execute: required file not found
74 patchShebangs packages/*/node_modules
77 ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
79 # remove giflib dependency
80 npmRebuildFlags = [ "--ignore-scripts" ];
82 # upstream keeps removing and adding back canvas, only patch it when it is present
83 if [[ -e node_modules/canvas/binding.gyp ]]; then
84 substituteInPlace node_modules/canvas/binding.gyp \
85 --replace-fail "'with_gif%': '<!(node ./util/has_lib.js gif)'" "'with_gif%': 'false'"
93 npm run build --workspace=packages/bruno-common
94 npm run build --workspace=packages/bruno-graphql-docs
95 npm run build --workspace=packages/bruno-app
96 npm run build --workspace=packages/bruno-query
98 npm run sandbox:bundle-libraries --workspace=packages/bruno-js
100 bash scripts/build-electron.sh
102 pushd packages/bruno-electron
105 if stdenv.hostPlatform.isDarwin then
107 cp -r ${electron.dist}/Electron.app ./
108 find ./Electron.app -name 'Info.plist' | xargs -d '\n' chmod +rw
110 substituteInPlace electron-builder-config.js \
111 --replace-fail "identity: 'Anoop MD (W7LPPWA48L)'" 'identity: null' \
112 --replace-fail "afterSign: 'notarize.js'," ""
114 npm exec electron-builder -- \
116 --config electron-builder-config.js \
118 -c.electronVersion=${electron.version} \
123 npm exec electron-builder -- \
125 -c.electronDist=${electron.dist} \
126 -c.electronVersion=${electron.version} \
136 npmPackFlags = [ "--ignore-scripts" ];
142 if stdenv.hostPlatform.isDarwin then
144 mkdir -p $out/Applications
146 cp -R packages/bruno-electron/out/**/Bruno.app $out/Applications/
150 mkdir -p $out/opt/bruno $out/bin
152 cp -r packages/bruno-electron/dist/linux*-unpacked/{locales,resources{,.pak}} $out/opt/bruno
154 makeWrapper ${lib.getExe electron} $out/bin/bruno \
155 --add-flags $out/opt/bruno/resources/app.asar \
156 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
157 --set-default ELECTRON_IS_DEV 0 \
160 for s in 16 32 48 64 128 256 512 1024; do
162 install -Dm644 $src/packages/bruno-electron/resources/icons/png/$size.png $out/share/icons/hicolor/$size/apps/bruno.png
170 passthru.updateScript = nix-update-script { };
173 description = "Open-source IDE For exploring and testing APIs";
174 homepage = "https://www.usebruno.com";
175 license = lib.licenses.mit;
176 mainProgram = "bruno";
177 maintainers = with lib.maintainers; [
185 platforms = lib.platforms.linux ++ lib.platforms.darwin;