2023-07-09 16:16:22 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
makeDesktopItem,
|
|
|
|
copyDesktopItems,
|
2023-09-14 17:03:22 +00:00
|
|
|
nodejs_20,
|
2023-07-09 16:16:22 +00:00
|
|
|
fetchYarnDeps,
|
|
|
|
fixup_yarn_lock,
|
|
|
|
electron,
|
|
|
|
libpulseaudio,
|
|
|
|
pipewire,
|
|
|
|
alsa-utils,
|
|
|
|
which,
|
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "prospect-mail";
|
2023-11-21 15:28:36 +00:00
|
|
|
version = "0a85d2a0136fc0d3312c3ba59d8e5d864e601db5";
|
2023-07-09 16:16:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-09-14 17:03:22 +00:00
|
|
|
owner = "julian-alarcon";
|
2023-07-09 16:16:22 +00:00
|
|
|
repo = pname;
|
2023-09-14 17:03:22 +00:00
|
|
|
rev = version;
|
2023-11-21 15:28:36 +00:00
|
|
|
sha256 = "sha256-ErHxElJN3OnheYq46QM34fhe+lX/nNSxGlia/Ddwr8k=";
|
2023-07-09 16:16:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = "${src}/yarn.lock";
|
2023-11-21 15:28:36 +00:00
|
|
|
sha256 = "sha256-XSARG26RLeMvy4gva572wJg7YDMvvh3Vgmhkv6dhKnk=";
|
2023-07-09 16:16:22 +00:00
|
|
|
};
|
|
|
|
|
2023-09-14 17:03:22 +00:00
|
|
|
nativeBuildInputs = [nodejs_20.pkgs.yarn fixup_yarn_lock nodejs_20 copyDesktopItems makeWrapper];
|
2023-07-09 16:16:22 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn config --offline set yarn-offline-mirror $offlineCache
|
|
|
|
fixup_yarn_lock yarn.lock
|
|
|
|
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
|
|
|
patchShebangs node_modules/
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
yarn --offline electron-builder \
|
|
|
|
--dir ${
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then "--macos"
|
|
|
|
else "--linux"
|
|
|
|
} ${
|
|
|
|
if stdenv.hostPlatform.isAarch64
|
|
|
|
then "--arm64"
|
|
|
|
else "--x64"
|
|
|
|
} \
|
2023-09-14 17:03:22 +00:00
|
|
|
-c.electronDist=${electron}/libexec/electron \
|
2023-07-09 16:16:22 +00:00
|
|
|
-c.electronVersion=${electron.version}
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share/{applications,prospect-mail}
|
|
|
|
cp dist/${
|
|
|
|
if stdenv.isDarwin
|
|
|
|
then "darwin-"
|
|
|
|
else "linux-"
|
|
|
|
}${lib.optionalString stdenv.hostPlatform.isAarch64 "arm64-"}unpacked/resources/app.asar $out/share/prospect-mail/
|
|
|
|
|
2023-09-14 19:04:52 +00:00
|
|
|
mkdir -p $out/share/icons/hicolor/256x256/apps
|
|
|
|
cp build/icon.png $out/share/icons/hicolor/256x256/apps/prospect-mail.png
|
2023-07-09 16:16:22 +00:00
|
|
|
|
|
|
|
# Linux needs 'aplay' for notification sounds, 'libpulse' for meeting sound, and 'libpipewire' for screen sharing
|
|
|
|
makeWrapper '${electron}/bin/electron' "$out/bin/prospect-mail" \
|
|
|
|
${lib.optionalString stdenv.isLinux ''
|
|
|
|
--prefix PATH : ${lib.makeBinPath [alsa-utils which]} \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio pipewire]} \
|
|
|
|
''} \
|
|
|
|
--add-flags "$out/share/prospect-mail/app.asar" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
|
|
|
icon = pname;
|
|
|
|
desktopName = "Outlook for Linux";
|
|
|
|
comment = "Outlook wrapper client for Linux";
|
|
|
|
categories = ["Network" "Email"];
|
|
|
|
})
|
|
|
|
];
|
2023-08-23 01:41:24 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Prospect mail, Outlook client for linux";
|
|
|
|
homepage = "https://github.com/julian-alarcon/prospect-mail";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
2023-07-09 16:16:22 +00:00
|
|
|
}
|