vesktop: electron 35

This commit is contained in:
blahai 2025-03-31 00:57:14 +03:00
parent 01d3aaadf1
commit e2b1c1b430
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc
2 changed files with 121 additions and 118 deletions

View file

@ -1,6 +1,7 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
#nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
rust-overlay = {
url = "github:oxalica/rust-overlay/aefb7017d710f150970299685e8d8b549d653649";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -5,7 +5,7 @@
makeWrapper,
makeDesktopItem,
copyDesktopItems,
electron,
electron_35,
libicns,
pipewire,
libpulseaudio,
@ -13,128 +13,130 @@
pnpm_9,
nodejs,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "vesktop-git";
version = "1.5.5-unstable-2025-03-27";
}: let
electron = electron_35;
in
stdenv.mkDerivation (finalAttrs: {
pname = "vesktop-git";
version = "1.5.5-unstable-2025-03-27";
src = fetchFromGitHub {
owner = "Vencord";
repo = "Vesktop";
rev = "8f941966464c7a85a32f5c17878f35bfed4d2bc6";
hash = "sha256-/ov3xgIbtJM6FlrK45UOq+/UrIJDRVn56sXdVx+iiZ8=";
};
src = fetchFromGitHub {
owner = "Vencord";
repo = "Vesktop";
rev = "8f941966464c7a85a32f5c17878f35bfed4d2bc6";
hash = "sha256-/ov3xgIbtJM6FlrK45UOq+/UrIJDRVn56sXdVx+iiZ8=";
};
pnpmDeps = pnpm_9.fetchDeps {
inherit
(finalAttrs)
pname
version
src
patches
;
hash = "sha256-qdKjfB5KaKvvlLINw5IVFvc5E4gcVaQrywrrU83XQ4k=";
};
pnpmDeps = pnpm_9.fetchDeps {
inherit
(finalAttrs)
pname
version
src
patches
;
hash = "sha256-qdKjfB5KaKvvlLINw5IVFvc5E4gcVaQrywrrU83XQ4k=";
};
nativeBuildInputs = [
nodejs
pnpm_9.configHook
autoPatchelfHook
copyDesktopItems
makeWrapper
];
buildInputs = [
libpulseaudio
pipewire
(lib.getLib stdenv.cc.cc)
];
patches = [
./disable_update_checking.patch
./fix_read_only_settings.patch
];
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
};
buildPhase = ''
runHook preBuild
pnpm build
pnpm exec electron-builder \
--dir \
-c.asarUnpack="**/*.node" \
-c.electronDist=${electron.dist} \
-c.electronVersion=${electron.version}
runHook postBuild
'';
postBuild = ''
pushd build
${libicns}/bin/icns2png -x icon.icns
popd
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt/Vesktop
cp -r dist/*unpacked/resources $out/opt/Vesktop/
for file in build/icon_*x32.png; do
file_suffix=''${file//build\/icon_}
install -Dm0644 $file $out/share/icons/hicolor/''${file_suffix//x32.png}/apps/vesktop.png
done
runHook postInstall
'';
postFixup = ''
makeWrapper ${electron}/bin/electron $out/bin/vesktop \
--add-flags $out/opt/Vesktop/resources/app.asar \
--add-flags "--enable-blink-features=MiddleClickAutoscroll" \
--add-flags "--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true"
'';
desktopItems = makeDesktopItem {
name = "vesktop";
desktopName = "Vesktop";
exec = "vesktop %U";
icon = "vesktop";
startupWMClass = "Vesktop";
genericName = "Internet Messenger";
keywords = [
"discord"
"vencord"
"electron"
"chat"
nativeBuildInputs = [
nodejs
pnpm_9.configHook
autoPatchelfHook
copyDesktopItems
makeWrapper
];
categories = [
"Network"
"InstantMessaging"
"Chat"
];
};
passthru = {
inherit (finalAttrs) pnpmDeps;
updateScript = nix-update-script {
extraArgs = [
"--version"
"branch=HEAD"
buildInputs = [
libpulseaudio
pipewire
(lib.getLib stdenv.cc.cc)
];
patches = [
./disable_update_checking.patch
./fix_read_only_settings.patch
];
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
};
buildPhase = ''
runHook preBuild
pnpm build
pnpm exec electron-builder \
--dir \
-c.asarUnpack="**/*.node" \
-c.electronDist=${electron.dist} \
-c.electronVersion=${electron.version}
runHook postBuild
'';
postBuild = ''
pushd build
${libicns}/bin/icns2png -x icon.icns
popd
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt/Vesktop
cp -r dist/*unpacked/resources $out/opt/Vesktop/
for file in build/icon_*x32.png; do
file_suffix=''${file//build\/icon_}
install -Dm0644 $file $out/share/icons/hicolor/''${file_suffix//x32.png}/apps/vesktop.png
done
runHook postInstall
'';
postFixup = ''
makeWrapper ${electron}/bin/electron $out/bin/vesktop \
--add-flags $out/opt/Vesktop/resources/app.asar \
--add-flags "--enable-blink-features=MiddleClickAutoscroll" \
--add-flags "--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true"
'';
desktopItems = makeDesktopItem {
name = "vesktop";
desktopName = "Vesktop";
exec = "vesktop %U";
icon = "vesktop";
startupWMClass = "Vesktop";
genericName = "Internet Messenger";
keywords = [
"discord"
"vencord"
"electron"
"chat"
];
categories = [
"Network"
"InstantMessaging"
"Chat"
];
};
};
meta = {
description = "Alternate client for Discord with Vencord built-in. Git version";
homepage = "https://github.com/Vencord/Vesktop";
license = lib.licenses.gpl3Only;
mainProgram = "vesktop";
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
})
passthru = {
inherit (finalAttrs) pnpmDeps;
updateScript = nix-update-script {
extraArgs = [
"--version"
"branch=HEAD"
];
};
};
meta = {
description = "Alternate client for Discord with Vencord built-in. Git version";
homepage = "https://github.com/Vencord/Vesktop";
license = lib.licenses.gpl3Only;
mainProgram = "vesktop";
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
})