Unverified Commit 2aa16f19 authored by seth's avatar seth
Browse files

vesktop: reformat

parent 4d07bdc0
Loading
Loading
Loading
Loading
+70 −45
Original line number Diff line number Diff line
{ lib
, stdenv
, stdenvNoCC
, fetchFromGitHub
, substituteAll
, makeWrapper
, makeDesktopItem
, copyDesktopItems
, vencord
, electron
, libicns
, jq
, moreutils
, cacert
, nodePackages
, pipewire
, libpulseaudio
, autoPatchelfHook
, withTTS ? true
{
  lib,
  stdenv,
  stdenvNoCC,
  fetchFromGitHub,
  substituteAll,
  makeWrapper,
  makeDesktopItem,
  copyDesktopItems,
  vencord,
  electron,
  libicns,
  jq,
  moreutils,
  cacert,
  nodePackages,
  pipewire,
  libpulseaudio,
  autoPatchelfHook,
  withTTS ? true,
  # Enables the use of vencord from nixpkgs instead of
  # letting vesktop manage it's own version
, withSystemVencord ? false
  withSystemVencord ? false,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "vesktop";
@@ -38,7 +39,12 @@ stdenv.mkDerivation (finalAttrs: {
    assert lib.versionAtLeast nodePackages.pnpm.version "8.10.0";
    stdenvNoCC.mkDerivation {
      pname = "${finalAttrs.pname}-pnpm-deps";
      inherit (finalAttrs) src version patches ELECTRON_SKIP_BINARY_DOWNLOAD;
      inherit (finalAttrs)
        src
        version
        patches
        ELECTRON_SKIP_BINARY_DOWNLOAD
        ;

      nativeBuildInputs = [
        cacert
@@ -95,9 +101,12 @@ stdenv.mkDerivation (finalAttrs: {
    stdenv.cc.cc.lib
  ];

  patches = [
    ./disable_update_checking.patch
  ] ++ lib.optional withSystemVencord (substituteAll { inherit vencord; src = ./use_system_vencord.patch; });
  patches =
    [ ./disable_update_checking.patch ]
    ++ lib.optional withSystemVencord (substituteAll {
      inherit vencord;
      src = ./use_system_vencord.patch;
    });

  ELECTRON_SKIP_BINARY_DOWNLOAD = 1;

@@ -132,8 +141,7 @@ stdenv.mkDerivation (finalAttrs: {
  '';

  # this is consistent with other nixpkgs electron packages and upstream, as far as I am aware
  installPhase =
    ''
  installPhase = ''
    runHook preInstall

    mkdir -p $out/opt/Vesktop
@@ -162,8 +170,17 @@ stdenv.mkDerivation (finalAttrs: {
      icon = "vesktop";
      startupWMClass = "Vesktop";
      genericName = "Internet Messenger";
      keywords = [ "discord" "vencord" "electron" "chat" ];
      categories = [ "Network" "InstantMessaging" "Chat" ];
      keywords = [
        "discord"
        "vencord"
        "electron"
        "chat"
      ];
      categories = [
        "Network"
        "InstantMessaging"
        "Chat"
      ];
    })
  ];

@@ -176,8 +193,16 @@ stdenv.mkDerivation (finalAttrs: {
    homepage = "https://github.com/Vencord/Vesktop";
    changelog = "https://github.com/Vencord/Vesktop/releases/tag/${finalAttrs.src.rev}";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ getchoo Scrumplex vgskye pluiedev ];
    platforms = [ "x86_64-linux" "aarch64-linux" ];
    maintainers = with lib.maintainers; [
      getchoo
      Scrumplex
      vgskye
      pluiedev
    ];
    platforms = [
      "x86_64-linux"
      "aarch64-linux"
    ];
    mainProgram = "vesktop";
  };
})