-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
330e722
commit 89b0352
Showing
4 changed files
with
174 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
lib, | ||
buildNpmPackage, | ||
fetchurl, | ||
copyDesktopItems, | ||
makeDesktopItem, | ||
makeWrapper, | ||
libpng, | ||
libX11, | ||
libXi, | ||
libXtst, | ||
zlib, | ||
electron, | ||
pipewire, | ||
}: | ||
buildNpmPackage rec { | ||
pname = "notion-app-electron"; | ||
version = "3.1.1-1"; | ||
|
||
src = fetchurl { | ||
url = "https://desktop-release.notion-static.com/Notion%20Setup%20${version}.exe"; | ||
hash = "sha256-b55742085cf723ea2d13dd6f97969b87329646028f540692fc8e070c16d49958="; | ||
}; | ||
|
||
# "https://desktop-release.notion-static.com/Notion%20Setup%20${pkgver}.exe" | ||
# https://github.com/WiseLibs/better-sqlite3/releases/download/v9.2.2/better-sqlite3-v9.2.2-electron-v119-linux-x64.tar.gz | ||
# | ||
nativeBuildInputs = [ | ||
copyDesktopItems | ||
makeWrapper | ||
]; | ||
|
||
# robotjs node-gyp dependencies | ||
buildInputs = [ | ||
libpng | ||
libX11 | ||
libXi | ||
libXtst | ||
zlib | ||
]; | ||
|
||
npmDepsHash = "sha256-JZVJcKzG4X7YIUvIRWZsDQnHx+dNqCj6kFm8mZaSH2k="; | ||
|
||
makeCacheWritable = true; | ||
|
||
env.ELECTRON_SKIP_BINARY_DOWNLOAD = 1; | ||
|
||
postPatch = '' | ||
substituteInPlace main.js \ | ||
--replace "require('electron-is-dev')" "false" | ||
''; | ||
|
||
preBuild = '' | ||
# remove some prebuilt binaries | ||
find node_modules -type d -name prebuilds -exec rm -r {} + | ||
''; | ||
|
||
postBuild = '' | ||
# generate .asar file | ||
# asarUnpack makes sure to unwrap binaries so that nix can see the RPATH | ||
npm exec electron-builder -- \ | ||
--dir \ | ||
-c.asarUnpack="**/*.node" \ | ||
-c.electronDist=${electron}/libexec/electron \ | ||
-c.electronVersion=${electron.version} | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/share/notion-app-electron | ||
cp -r dist/*-unpacked/{locales,resources{,.pak}} $out/share/notion-app-electron | ||
makeWrapper ${lib.getExe electron} $out/bin/notion-app-electron \ | ||
--add-flags $out/share/jitsi-meet-electron/resources/app.asar \ | ||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [pipewire]} \ | ||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ | ||
--inherit-argv0 | ||
install -Dm644 resources/icons/512x512.png $out/share/icons/hicolor/512x512/apps/jitsi-meet-electron.png | ||
runHook postInstall | ||
''; | ||
|
||
|
||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = "notion-app-electron"; | ||
exec = "notion-app-electron %U"; | ||
icon = "notion-app-electron"; | ||
desktopName = "Notion"; | ||
comment = meta.description; | ||
categories = ["VideoConference" "AudioVideo" "Audio" "Video" "Network"]; | ||
mimeTypes = ["x-scheme-handler/jitsi-meet"]; | ||
terminal = false; | ||
}) | ||
]; | ||
|
||
meta = with lib; { | ||
description = "Your connected workspace for wiki, docs & projects"; | ||
homepage = "https://aur.archlinux.org/packages/notion-app-electron"; | ||
mainProgram = "notion-app-electron"; | ||
inherit (electron.meta) platforms; | ||
}; | ||
} |