Skip to content

Commit

Permalink
flake.lock: update
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Aug 29, 2024
1 parent 8a29f92 commit 880a346
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 35 deletions.
56 changes: 28 additions & 28 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
permittedInsecurePackages = [
"freeimage-unstable-2021-11-01"
"jitsi-meet-1.0.8043"
"electron-29.4.6"
];
};

Expand Down
7 changes: 1 addition & 6 deletions modules/home/programs/terminal/tools/fastfetch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@ in

programs.fastfetch = {
enable = true;
package =
# NOTE: Getting missing X11 header during compilation for some reason on darwin all of a sudden.
if pkgs.stdenv.isDarwin then
pkgs.fastfetch.override { imagemagick_light = pkgs.imagemagick; }
else
pkgs.fastfetch;
package = pkgs.fastfetch;

settings = {
"$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json";
Expand Down
4 changes: 3 additions & 1 deletion modules/home/suites/business/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ in
]
++ lib.optionals stdenv.isLinux [
libreoffice
teams-for-linux
# TODO: replace once https://github.com/NixOS/nixpkgs/pull/337868 is available
# teams-for-linux
pkgs.khanelinix.teams-for-linux
]
++ lib.optionals stdenv.isDarwin [ teams ];

Expand Down
113 changes: 113 additions & 0 deletions packages/teams-for-linux/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
lib,
stdenv,
buildNpmPackage,
fetchFromGitHub,
alsa-utils,
copyDesktopItems,
electron_30,
makeDesktopItem,
makeWrapper,
which,
}:

let
electronDist = "${electron_30}/${if stdenv.isDarwin then "Applications" else "libexec/electron"}";
in
buildNpmPackage rec {
pname = "teams-for-linux";
version = "1.9.5";

src = fetchFromGitHub {
owner = "IsmaelMartinez";
repo = "teams-for-linux";
rev = "refs/tags/v${version}";
hash = "sha256-+rEGDg+/qvjCMhGHccb4p+CKOo/65RpkFT/WnCDlCgU=";
};

npmDepsHash = "sha256-vDRFFxkIQo5qU9gmkSwUhPz4FG2XbUNkTw6SCuvMqCc=";

nativeBuildInputs = [
makeWrapper
] ++ lib.optionals stdenv.isLinux [ copyDesktopItems ];

env = {
# disable code signing on Darwin
CSC_IDENTITY_AUTO_DISCOVERY = "false";
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
};

buildPhase = ''
runHook preBuild
cp -r ${electronDist} electron-dist
chmod -R u+w electron-dist
npm exec electron-builder -- \
--dir \
-c.npmRebuild=true \
-c.asarUnpack="**/*.node" \
-c.electronDist=electron-dist \
-c.electronVersion=${electron_30.version}
runHook postBuild
'';

installPhase =
''
runHook preInstall
''
+ lib.optionalString stdenv.isLinux ''
mkdir -p $out/share/{applications,teams-for-linux}
cp dist/*-unpacked/resources/app.asar $out/share/teams-for-linux/
pushd build/icons
for image in *png; do
mkdir -p $out/share/icons/hicolor/''${image%.png}/apps
cp -r $image $out/share/icons/hicolor/''${image%.png}/apps/teams-for-linux.png
done
popd
# Linux needs 'aplay' for notification sounds
makeWrapper '${lib.getExe electron_30}' "$out/bin/teams-for-linux" \
--prefix PATH : ${
lib.makeBinPath [
alsa-utils
which
]
} \
--add-flags "$out/share/teams-for-linux/app.asar" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
''
+ lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
cp -r dist/mac*/teams-for-linux.app $out/Applications
makeWrapper $out/Applications/teams-for-linux.app/Contents/MacOS/teams-for-linux $out/bin/teams-for-linux
''
+ ''
runHook postInstall
'';

desktopItems = [
(makeDesktopItem {
name = "teams-for-linux";
exec = "teams-for-linux";
icon = "teams-for-linux";
desktopName = "Microsoft Teams for Linux";
comment = meta.description;
categories = [
"Network"
"InstantMessaging"
"Chat"
];
})
];

meta = {
description = "Unofficial Microsoft Teams client for Linux";
mainProgram = "teams-for-linux";
platforms = with lib.platforms; darwin ++ linux;
};
}

0 comments on commit 880a346

Please sign in to comment.