Code change:
<ins> { lib, stdenv, buildNpmPackage, fetchFromGitHub, copyDesktopItems , python3, pipewire, libpulseaudio, xdg-utils, electron_22, makeDesktopItem }: buildNpmPackage rec { name = "webcord"; version = "4.1.1"; src = fetchFromGitHub { owner = "SpacingBat3"; repo = "WebCord"; rev = "v${version}"; sha256 = "sha256-Buu7eKmI0UGV/9Kfj+urmDcjBtR9HSwW+mlHaYhfUa4="; }; npmDepsHash = "sha256-PeoOoEljbkHynjZwocCWCTyYvIvSE1gQiABUzIiXEdM="; nativeBuildInputs = [ copyDesktopItems python3 ]; libPath = lib.makeLibraryPath [ pipewire libpulseaudio ]; binPath = lib.makeBinPath [ xdg-utils ]; # npm install will error when electron tries to download its binary # we don't need it anyways since we wrap the program with our nixpkgs electron ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; # remove husky commit hooks, errors and aren't needed for packaging postPatch = '' rm -rf .husky ''; # override installPhase so we can copy the only folders that matter installPhase = '' runHook preInstall # Remove dev deps that aren't necessary for running the app npm prune --omit=dev mkdir -p $out/lib/node_modules/webcord cp -r app node_modules sources package.json $out/lib/node_modules/webcord/ install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png makeWrapper '${electron_22}/bin/electron' $out/bin/webcord  --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/webcord  --prefix PATH : "${binPath}"  --add-flags "''${NIXOS_OZONE_WL:+''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"  --add-flags $out/lib/node_modules/webcord/ runHook postInstall ''; desktopItems = [ (makeDesktopItem { name = "webcord"; exec = "webcord"; icon = "webcord"; desktopName = "WebCord"; comment = meta.description; categories = [ "Network" "InstantMessaging" ]; }) ]; meta = with lib; { description = "A Discord and Fosscord electron-based client implemented without Discord API"; homepage = "https://github.com/SpacingBat3/WebCord"; downloadPage = "https://github.com/SpacingBat3/WebCord/releases"; changelog = "https://github.com/SpacingBat3/WebCord/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ huantian ]; platforms = electron_22.meta.platforms; }; } </ins>

Related discussion:
text: Project description Alternate Discord and Fosscord client made to be private, secure, customizable, and Linux friendly. Metadata homepage URL: source URL: license: MIT platforms: x86_64 and aarch64 on linux, darwin, windows
I had a shot at trying to package this from source, but it seems that for whatever reason, the nixpkgs' Electron crashes with SIGTRAP when trying to run with source. I haven't had much luck using on Electron to find a root cause either. Haven't tried using the AppImage yet, though.
I don't think the appimage will have much difference, but I've also gotten the same error. There is now a that uses dream2nix to package it properly
I made a derivation that doesn't use dream2nix, and it's available at if it's of any use. The SIGTRAP issue was just a bad Electron version, from what I could tell. I haven't submitted this to nixpkgs yet purely because I want merged first.
Ah it would make sense for the SIGTRAP to be an electron version issue, I've had it on a few other electron apps too. Your derivation looks pretty good, might try it out. Wonder how long it will take the pr you mentioned to be finished tho
The PR has been marked as a blocker for 22.11, so at the very latest, end of November. May be an excessive amount of time to wait, though.
Now that is mostly done and merged, I've used it to make a nice and simple derivation for it:
Looks great. Not sure if you're planning on submitting this to nixpkgs, but if you are it might be worth adding arm64 support as well.
Yeah it would be nice to get this to work on aarch64 and/or darwin too, but I don’t have any devices to test it on. Can you help with this? The package might already even work on arm since we're just wrapping nixpkgs electron. I’m also down to put this on nixpkgs, might wanna do a bit more testing and tweaking; if you can see any places for improvement that'd be great!
is there anything that would stop this package from running on i686?