Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00

88 lines
1.9 KiB
Nix

{
lib,
fetchFromGitHub,
buildNpmPackage,
python3,
electron_35,
makeDesktopItem,
makeShellWrapper,
copyDesktopItems,
}:
buildNpmPackage rec {
pname = "zulip";
version = "5.12.0";
src = fetchFromGitHub {
owner = "zulip";
repo = "zulip-desktop";
tag = "v${version}";
hash = "sha256-YDb69tJCR58DARssnZgdVxtRpR8vHsawCTv7kQ56y+8=";
};
npmDepsHash = "sha256-MKKN6prUdWaHm27GybdbswDMNJH0xVffXsT2ZwroOHI=";
env = {
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
};
nativeBuildInputs = [
makeShellWrapper
copyDesktopItems
(python3.withPackages (ps: with ps; [ distutils ]))
];
dontNpmBuild = true;
buildPhase = ''
runHook preBuild
npm run pack -- \
-c.electronDist=${electron_35}/libexec/electron \
-c.electronVersion=${electron_35.version}
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p "$out/share/lib/zulip"
cp -r dist/*-unpacked/resources/app.asar* "$out/share/lib/zulip/"
install -m 444 -D app/resources/zulip.png $out/share/icons/hicolor/512x512/apps/zulip.png
makeShellWrapper '${lib.getExe electron_35}' "$out/bin/zulip" \
--add-flags "$out/share/lib/zulip/app.asar" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-wayland-ime=true}}" \
--inherit-argv0
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "zulip";
exec = "zulip %U";
icon = "zulip";
desktopName = "Zulip";
comment = "Zulip Desktop Client for Linux";
categories = [
"Chat"
"Network"
"InstantMessaging"
];
startupWMClass = "Zulip";
terminal = false;
})
];
meta = with lib; {
description = "Desktop client for Zulip Chat";
homepage = "https://zulip.com";
license = licenses.asl20;
maintainers = with maintainers; [ andersk ];
platforms = lib.platforms.linux;
mainProgram = "zulip";
};
}