18 stdenv.mkDerivation (finalAttrs: {
19 pname = "teams-for-linux";
22 src = fetchFromGitHub {
23 owner = "IsmaelMartinez";
24 repo = "teams-for-linux";
25 rev = "v${finalAttrs.version}";
26 hash = "sha256-nUHiveS1XI+vC2Tj1DK/DS4CrKTLMg1IYgTPWXuLrAc=";
29 offlineCache = fetchYarnDeps {
30 yarnLock = "${finalAttrs.src}/yarn.lock";
31 hash = "sha256-jBwyIyiWeqNmOnxmVOr7c4oMWwHElEjM25sShhTMi78=";
34 nativeBuildInputs = [ yarn fixup-yarn-lock nodejs copyDesktopItems makeWrapper ];
39 export HOME=$(mktemp -d)
40 yarn config --offline set yarn-offline-mirror $offlineCache
41 fixup-yarn-lock yarn.lock
42 yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
43 patchShebangs node_modules/
51 yarn --offline electron-builder \
52 --dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \
53 -c.electronDist=${electron}/libexec/electron \
54 -c.electronVersion=${electron.version}
62 mkdir -p $out/share/{applications,teams-for-linux}
63 cp dist/${if stdenv.isDarwin then "darwin-" else "linux-"}${lib.optionalString stdenv.hostPlatform.isAarch64 "arm64-"}unpacked/resources/app.asar $out/share/teams-for-linux/
67 mkdir -p $out/share/icons/hicolor/''${image%.png}/apps
68 cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png
72 # Linux needs 'aplay' for notification sounds
73 makeWrapper '${electron}/bin/electron' "$out/bin/teams-for-linux" \
74 ${lib.optionalString stdenv.isLinux ''
75 --prefix PATH : ${lib.makeBinPath [ alsa-utils which ]} \
77 --add-flags "$out/share/teams-for-linux/app.asar" \
78 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
83 desktopItems = [(makeDesktopItem {
84 name = finalAttrs.pname;
85 exec = finalAttrs.pname;
86 icon = finalAttrs.pname;
87 desktopName = "Microsoft Teams for Linux";
88 comment = finalAttrs.meta.description;
89 categories = [ "Network" "InstantMessaging" "Chat" ];
92 passthru.updateScript = ./update.sh;
93 passthru.tests.version = testers.testVersion rec {
94 package = teams-for-linux;
95 command = "HOME=$TMPDIR ${package.meta.mainProgram or package.pname} --version";
99 description = "Unofficial Microsoft Teams client for Linux";
100 mainProgram = "teams-for-linux";
101 homepage = "https://github.com/IsmaelMartinez/teams-for-linux";
102 license = lib.licenses.gpl3Only;
103 maintainers = with lib.maintainers; [ muscaln lilyinstarlight qjoly chvp ];
104 platforms = lib.platforms.unix;
105 broken = stdenv.isDarwin;