16 src = fetchFromGitHub {
17 owner = "SpacingBat3";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-vzTT8tHpbJSt1PosgKTg3pT4a9UfPabtJppLLD9znhU=";
23 npmDepsHash = "sha256-nVQv+GSnfQa8V/RitvV2juokbiRJ/vIMLWcg9QPDbP0=";
30 # npm install will error when electron tries to download its binary
31 # we don't need it anyways since we wrap the program with our nixpkgs electron
32 env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
34 # remove husky commit hooks, errors and aren't needed for packaging
39 # override installPhase so we can copy the only folders that matter
42 binPath = lib.makeBinPath [ xdg-utils ];
47 # Remove dev deps that aren't necessary for running the app
50 mkdir -p $out/lib/node_modules/webcord
51 cp -r app node_modules sources package.json $out/lib/node_modules/webcord/
53 install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png
55 # Add xdg-utils to path via suffix, per PR #181171
56 makeWrapper '${lib.getExe electron}' $out/bin/webcord \
57 --suffix PATH : "${binPath}" \
58 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime}}" \
59 --add-flags $out/lib/node_modules/webcord/
69 desktopName = "WebCord";
70 comment = meta.description;
78 passthru.updateScript = ./update.sh;
81 description = "A Discord and SpaceBar electron-based client implemented without Discord API";
82 homepage = "https://github.com/SpacingBat3/WebCord";
83 downloadPage = "https://github.com/SpacingBat3/WebCord/releases";
84 changelog = "https://github.com/SpacingBat3/WebCord/releases/tag/v${version}";
85 license = lib.licenses.mit;
86 mainProgram = "webcord";
87 maintainers = with lib.maintainers; [
90 platforms = lib.platforms.linux;