diff options
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/webcord/default.nix')
-rw-r--r-- | pkgs/applications/networking/instant-messengers/webcord/default.nix | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/pkgs/applications/networking/instant-messengers/webcord/default.nix b/pkgs/applications/networking/instant-messengers/webcord/default.nix index 6417153c093..df995010198 100644 --- a/pkgs/applications/networking/instant-messengers/webcord/default.nix +++ b/pkgs/applications/networking/instant-messengers/webcord/default.nix @@ -6,37 +6,32 @@ , pipewire , libpulseaudio , xdg-utils -, electron_25 +, electron_27 , makeDesktopItem , nix-update-script }: buildNpmPackage rec { pname = "webcord"; - version = "4.4.1"; + version = "4.5.1"; src = fetchFromGitHub { owner = "SpacingBat3"; repo = "WebCord"; rev = "v${version}"; - hash = "sha256-g9UJANYs5IlKAeRc27oNOfdD3uD3nrG5Ecp+AbbsXLE="; + hash = "sha256-isrExJeONhIxJUXOsMMq8l9xF9amInBGnb5D+DKuzHw="; }; - npmDepsHash = "sha256-SSlSLZs97LDtL7OyfCtEGZjDVfsn5KKUgRNyL8J5M5g="; + npmDepsHash = "sha256-RTYPxS6uLLCIu4JfQqMQP8y8+S5uwe3KXWNlbe7/A7Q="; nativeBuildInputs = [ copyDesktopItems python3 ]; - libPath = lib.makeLibraryPath [ - pipewire - libpulseaudio - ]; - # 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"; + env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; # remove husky commit hooks, errors and aren't needed for packaging postPatch = '' @@ -44,7 +39,15 @@ buildNpmPackage rec { ''; # override installPhase so we can copy the only folders that matter - installPhase = '' + installPhase = + let + libPath = lib.makeLibraryPath [ + libpulseaudio + pipewire + ]; + binPath = lib.makeBinPath [ xdg-utils ]; + in + '' runHook preInstall # Remove dev deps that aren't necessary for running the app @@ -56,10 +59,10 @@ buildNpmPackage rec { install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png # Add xdg-utils to path via suffix, per PR #181171 - makeWrapper '${electron_25}/bin/electron' $out/bin/webcord \ + makeWrapper '${lib.getExe electron_27}' $out/bin/webcord \ --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/webcord \ - --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}" \ + --suffix PATH : "${binPath}" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ --add-flags $out/lib/node_modules/webcord/ runHook postInstall @@ -78,14 +81,14 @@ buildNpmPackage rec { passthru.updateScript = nix-update-script { }; - meta = with lib; { - description = "A Discord and Fosscord electron-based client implemented without Discord API"; + meta = { + description = "A Discord and SpaceBar 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; + license = lib.licenses.mit; mainProgram = "webcord"; - maintainers = with maintainers; [ huantian ]; - platforms = platforms.linux; + maintainers = with lib.maintainers; [ eclairevoyant huantian ]; + platforms = lib.platforms.linux; }; } |